mirror of
https://github.com/kvz/bash3boilerplate.git
synced 2025-04-23 14:53:34 +00:00
Enable color in screen or tmux
This commit is contained in:
parent
63c402912a
commit
12ea4dd75f
@ -15,6 +15,7 @@ Released: TBA.
|
||||
|
||||
- [ ] Upgrade to `lanyon@0.0.55`
|
||||
- [x] Fix typos in megamount (thanks @gsaponaro)
|
||||
- [x] Enable color in screen or tmux (@gmasse)
|
||||
|
||||
## v2.3.0
|
||||
|
||||
|
@ -163,6 +163,7 @@ We are looking for endorsements! Are you also using b3bp? [Let us know](https://
|
||||
- [galaktos](https://www.reddit.com/user/galaktos) (feedback)
|
||||
- [@moviuro](https://github.com/moviuro) (feedback)
|
||||
- [Giovanni Saponaro](https://github.com/gsaponaro) (feedback)
|
||||
- [Germain Masse](https://github.com/gmasse)
|
||||
|
||||
## License
|
||||
|
||||
|
2
main.sh
2
main.sh
@ -83,7 +83,7 @@ function __b3bp_log () {
|
||||
local color="${!colorvar:-${color_error}}"
|
||||
local color_reset="\x1b[0m"
|
||||
|
||||
if [[ "${NO_COLOR:-}" = "true" ]] || [[ "${TERM:-}" != "xterm"* ]] || [[ ! -t 2 ]]; then
|
||||
if [[ "${NO_COLOR:-}" = "true" ]] || ( [[ "${TERM:-}" != "xterm"* ]] && [[ "${TERM:-}" != "screen"* ]] ) || [[ ! -t 2 ]]; then
|
||||
if [[ "${NO_COLOR:-}" != "false" ]]; then
|
||||
# Don't use colors on pipes or non-recognized terminals
|
||||
color=""; color_reset=""
|
||||
|
@ -63,7 +63,7 @@ __node="$(which node)"
|
||||
__arch="amd64"
|
||||
|
||||
# explicitly setting NO_COLOR to false will make b3bp ignore TERM
|
||||
# not being "xterm*" and STDERR not being connected to a terminal
|
||||
# not being "xterm*" or "screen*" and STDERR not being connected to a terminal
|
||||
# it's the opposite of NO_COLOR="true" - it forces color, no matter what
|
||||
export NO_COLOR="false"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user