mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-18 11:50:07 +00:00
installer: allow for tput errors
tput may throw errors on invalid $TERM values, for example. This shorthand syntax allows for that as well as for if tput doesn't exist.
This commit is contained in:
parent
2e54ba2dfb
commit
0824dcc9fb
1 changed files with 1 additions and 5 deletions
|
@ -52,11 +52,7 @@ error() {
|
|||
|
||||
# Set up color sequences
|
||||
setup_color() {
|
||||
if command_exists tput; then
|
||||
ncolors=$(tput colors)
|
||||
else
|
||||
ncolors=0
|
||||
fi
|
||||
ncolors=$(tput colors 2>/dev/null) || ncolors=0
|
||||
|
||||
# Only use colors if connected to a terminal that supports them
|
||||
if [ -t 1 ] && [ $ncolors -ge 8 ]; then
|
||||
|
|
Loading…
Reference in a new issue