mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-20 03:02:29 +01:00
Option to force 256 colors with tmux
This commit is contained in:
parent
1b7a3ea99a
commit
6efc9cdd6e
1 changed files with 4 additions and 3 deletions
|
|
@ -32,6 +32,7 @@ if which tmux &> /dev/null
|
|||
# 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"
|
||||
[[ -n "$ZSH_TMUX_FORCE_256COLOR" ]] || ZSH_TMUX_FORCE_256COLOR=false
|
||||
|
||||
|
||||
# Get the absolute path to the current directory
|
||||
|
|
@ -61,15 +62,15 @@ if which tmux &> /dev/null
|
|||
# We have other arguments, just run them
|
||||
if [[ -n "$@" ]]
|
||||
then
|
||||
\tmux $@
|
||||
\tmux `[[ "$ZSH_TMUX_FORCE_256COLOR" == "true" ]] && echo '-2 '` $@
|
||||
# Try to connect to an existing session.
|
||||
elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]
|
||||
then
|
||||
\tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` attach || \tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session
|
||||
\tmux `[[ "$ZSH_TMUX_FORCE_256COLOR" == "true" ]] && echo '-2 '` `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` attach || \tmux `[[ "$ZSH_TMUX_FORCE_256COLOR" == "true" ]] && echo '-2 '` `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session
|
||||
[[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
|
||||
# Just run tmux, fixing the TERM variable if requested.
|
||||
else
|
||||
\tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG`
|
||||
\tmux `[[ "$ZSH_TMUX_FORCE_256COLOR" == "true" ]] && echo '-2 '` `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG`
|
||||
[[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue