From 4e8681c6e19f77a9b54ceee5934e3356e4ffb207 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 26 Feb 2013 23:35:45 -0500 Subject: [PATCH] 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. --- plugins/tmux/tmux.plugin.zsh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 5c407690..be92fe09 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -11,6 +11,14 @@ [[ -n "$ZSH_TMUX_AUTOQUIT" ]] || ZSH_TMUX_AUTOQUIT=$ZSH_TMUX_AUTOSTART # Set term to screen or screen-256color based on current terminal support [[ -n "$ZSH_TMUX_FIXTERM" ]] || ZSH_TMUX_FIXTERM=true +# The TERM to use for non-256 color terminals. +# Tmux states this should be screen, but you may need to change it on +# systems without the proper terminfo +[[ -n "$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITHOUT_256COLOR="screen" +# The TERM to use for 256 color terminals. +# Tmux states this should be screen-256color, but you may need to change it on +# systems without the proper terminfo +[[ -n "$ZSH_TMUX_FIXTERM_WITH_256COLOR" ]] || ZSH_TMUX_FIXTERM_WITH_256COLOR="screen-256color" # Get the absolute path to the current directory @@ -19,9 +27,9 @@ local zsh_tmux_plugin_path="$(cd "$(dirname "$0")" && pwd)" # Determine if the terminal supports 256 colors if [[ `tput colors` == "256" ]] then - export ZSH_TMUX_TERM="screen-256color" + export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR else - export ZSH_TMUX_TERM="screen" + export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR fi # Local variable to store the local config file to use, if any.