fix(tmux): treat xterm-direct as 256-color (#13700)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: lawrence3699 <lawrence3699@users.noreply.github.com>
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
This commit is contained in:
chaoliang yan 2026-04-20 19:00:37 +10:00 committed by GitHub
commit a4ee4daf3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -87,8 +87,8 @@ _build_tmux_alias "tkss" "kill-session" "-t"
unfunction _build_tmux_alias
# Determine if the terminal supports 256 colors
if [[ $terminfo[colors] == 256 ]]; then
# Determine if the terminal supports at least 256 colors
if (( ${+terminfo[colors]} )) && [[ $terminfo[colors] -ge 256 ]]; then
export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR
else
export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR