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.
This commit is contained in:
Josh Matthews 2013-02-26 23:35:45 -05:00
parent 86c9b32031
commit 4e8681c6e1

View File

@ -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.