Skip to content

Commit

Permalink
Fixing error in terminal color detection support
Browse files Browse the repository at this point in the history
  • Loading branch information
johanhaleby committed Feb 16, 2024
1 parent 6bed679 commit ae1a091
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kubetail
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ calculate_default_namespace() {
}

# Sets default color ouput to 'false' if output is not a terminal
terminal_aware_default_color=line
[ ! -t 1 ] && terminal_aware_default_color=false
if [ -n "$(tput colors)" ] && [ "$(tput colors)" -ge 8 ]; then
terminal_aware_default_color=line
else
terminal_aware_default_color=false
fi

default_previous="${KUBETAIL_PREVIOUS:-false}"
default_since="${KUBETAIL_SINCE:-10s}"
Expand Down

0 comments on commit ae1a091

Please sign in to comment.