a4ee4daf3c77376f9efd2e230e0353114b82339b
- Author
- chaoliang yan <z5643222@ad.unsw.edu.au>
- Committer
- GitHub <noreply@github.com>
- Date
Message
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>
Diff
1diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
2index b1d97e98f7b0551420fc3bbc84c2cba7e6a8976d..c501ad7013c01e772c2e4014c3b08609aab85524 100644
3--- a/plugins/tmux/tmux.plugin.zsh
4+++ b/plugins/tmux/tmux.plugin.zsh
5@@ -87,8 +87,8 @@ _build_tmux_alias "tkss" "kill-session" "-t"
6
7 unfunction _build_tmux_alias
8
9-# Determine if the terminal supports 256 colors
10-if [[ $terminfo[colors] == 256 ]]; then
11+# Determine if the terminal supports at least 256 colors
12+if (( ${+terminfo[colors]} )) && [[ $terminfo[colors] -ge 256 ]]; then
13 export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR
14 else
15 export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR