diff --git a/CHANGELOG.md b/CHANGELOG.md index 40dceaa..f77964e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 4fa6767..33ee6a4 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/main.sh b/main.sh index 6aa8bcb..fec3475 100755 --- a/main.sh +++ b/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="" diff --git a/test/acceptance.sh b/test/acceptance.sh index c4d31bf..09beddc 100755 --- a/test/acceptance.sh +++ b/test/acceptance.sh @@ -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"