fix doc and style
This commit is contained in:
@@ -323,7 +323,10 @@ term_set()
|
||||
|
||||
# Return true when terminfo has an entry for the given terminal type.
|
||||
local _term_has
|
||||
_term_has() { tput -T "$1" longname >/dev/null 2>&1; }
|
||||
_term_has()
|
||||
{
|
||||
tput -T "$1" longname >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# True-color hint: COLORTERM=truecolor|24bit is set by the emulator.
|
||||
local _truecolor=0
|
||||
@@ -386,7 +389,7 @@ term_set()
|
||||
# 5. tmux — prefer *-direct when truecolor, then *-256color, then screen-256color.
|
||||
if [[ -z "$_candidate" && -n "${TMUX:-}" ]]; then
|
||||
if (( _truecolor )); then
|
||||
_term_has "tmux-direct" && _candidate="tmux-direct"
|
||||
_term_has "tmux-direct" && _candidate="tmux-direct"
|
||||
[[ -z "$_candidate" ]] && _term_has "screen-direct" && _candidate="screen-direct"
|
||||
fi
|
||||
[[ -z "$_candidate" ]] && _term_has "tmux-256color" && _candidate="tmux-256color"
|
||||
@@ -396,7 +399,7 @@ term_set()
|
||||
# 6. GNU screen — prefer screen-direct when truecolor, then screen-256color.
|
||||
if [[ -z "$_candidate" && -n "${STY:-}" ]]; then
|
||||
if (( _truecolor )); then
|
||||
_term_has "screen-direct" && _candidate="screen-direct"
|
||||
_term_has "screen-direct" && _candidate="screen-direct"
|
||||
fi
|
||||
[[ -z "$_candidate" ]] && _term_has "screen-256color" && _candidate="screen-256color"
|
||||
[[ -z "$_candidate" ]] && _term_has "screen" && _candidate="screen"
|
||||
|
||||
Reference in New Issue
Block a user