mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
lib/utils: Support termcap names for "tput"
This commit is contained in:
18
lib/utils.sh
18
lib/utils.sh
@@ -103,15 +103,15 @@ if which tput >/dev/null 2>&1; then
|
|||||||
ncolors=$(tput colors)
|
ncolors=$(tput colors)
|
||||||
fi
|
fi
|
||||||
if [[ -t 1 && $ncolors && ncolors -ge 8 ]]; then
|
if [[ -t 1 && $ncolors && ncolors -ge 8 ]]; then
|
||||||
bold=$(tput bold 2>/dev/null)
|
bold=$(tput bold 2>/dev/null || tput md 2>/dev/null)
|
||||||
underline=$(tput sgr 0 1 2>/dev/null)
|
underline=$(tput smul 2>/dev/null || tput ul 2>/dev/null)
|
||||||
reset=$(tput sgr0 2>/dev/null)
|
reset=$(tput sgr0 2>/dev/null || tput me 2>/dev/null)
|
||||||
red=$(tput setaf 1 2>/dev/null)
|
red=$(tput setaf 1 2>/dev/null || tput AF 1 2>/dev/null)
|
||||||
green=$(tput setaf 2 2>/dev/null)
|
green=$(tput setaf 2 2>/dev/null || tput AF 2 2>/dev/null)
|
||||||
yellow=$(tput setaf 3 2>/dev/null)
|
yellow=$(tput setaf 3 2>/dev/null || tput AF 3 2>/dev/null)
|
||||||
blue=$(tput setaf 4 2>/dev/null)
|
blue=$(tput setaf 4 2>/dev/null || tput AF 4 2>/dev/null)
|
||||||
purple=$(tput setaf 171 2>/dev/null)
|
purple=$(tput setaf 171 2>/dev/null || tput AF 171 2>/dev/null)
|
||||||
tan=$(tput setaf 3 2>/dev/null)
|
tan=$(tput setaf 3 2>/dev/null || tput AF 3 2>/dev/null)
|
||||||
else
|
else
|
||||||
bold=""
|
bold=""
|
||||||
underline=""
|
underline=""
|
||||||
|
Reference in New Issue
Block a user