Enable color in screen or tmux

This commit is contained in:
Germain Masse 2017-08-13 21:08:59 +02:00
parent 63c402912a
commit 12ea4dd75f
No known key found for this signature in database
GPG Key ID: 1BD5931FF75F3EAC
4 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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=""

View File

@ -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"