Adding options to choose tmux TERM for 256 and non-256 color terminals.
This may be needed on systems that don't have the proper terminfo for
screen and/or screen-256color. Otherwise the defaults of screen and
screen-256color should be fine.
Diff
1diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
2index 5c407690401479f20fdabd34a8a1b30990caf909..be92fe096a8e76fba9cf43ff7e455e6b2b783856 100644
3--- a/plugins/tmux/tmux.plugin.zsh
4+++ b/plugins/tmux/tmux.plugin.zsh
5@@ -11,6 +11,14 @@
6 [[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT=$ZSH_TMUX_AUTOSTART
7 # Set term to screen or screen-256color based on current terminal support
8 [[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_FIXTERM=true
9+# The TERM to use for non-256 color terminals.
10+# Tmux states this should be screen, but you may need to change it on
11+# systems without the proper terminfo
12+[[ -n "$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITHOUT_256COLOR="screen"
13+# The TERM to use for 256 color terminals.
14+# Tmux states this should be screen-256color, but you may need to change it on
15+# systems without the proper terminfo
16+[[ -n "$ZSH_TMUX_FIXTERM_WITH_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITH_256COLOR="screen-256color"
171819 # Get the absolute path to the current directory
20@@ -19,9 +27,9 @@ local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)"
21 # Determine if the terminal supports 256 colors
22 if [[ `tput colors` == "256" ]]
23 then
24- export ZSH_TMUX_TERM="screen-256color"
25+ export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR
26 else
27- export ZSH_TMUX_TERM="screen"
28+ export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR
29 fi
3031 # Local variable to store the local config file to use, if any.