mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-22 22:00:08 +00:00
Exporting path to fixed config as a global variable.
This is done to fix compatibility with antigen. To keep with convention, the variable has been renamed to be in all caps.
This commit is contained in:
parent
a91872df35
commit
19ae0b576c
1 changed files with 4 additions and 7 deletions
|
@ -35,17 +35,14 @@ if which tmux &> /dev/null
|
||||||
export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR
|
export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Local variable to store the local config file to use, if any.
|
|
||||||
local fixed_config=""
|
|
||||||
|
|
||||||
# Set the correct local config file to use.
|
# Set the correct local config file to use.
|
||||||
if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]]
|
if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]]
|
||||||
then
|
then
|
||||||
#use this when they have a ~/.tmux.conf
|
#use this when they have a ~/.tmux.conf
|
||||||
fixed_config="$zsh_tmux_plugin_path/tmux.extra.conf"
|
export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.extra.conf"
|
||||||
else
|
else
|
||||||
#use this when they don't have a ~/.tmux.conf
|
#use this when they don't have a ~/.tmux.conf
|
||||||
fixed_config="$zsh_tmux_plugin_path/tmux.only.conf"
|
export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.only.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Wrapper function for tmux.
|
# Wrapper function for tmux.
|
||||||
|
@ -58,11 +55,11 @@ if which tmux &> /dev/null
|
||||||
# Try to connect to an existing session.
|
# Try to connect to an existing session.
|
||||||
elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]
|
elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]
|
||||||
then
|
then
|
||||||
\tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config` new-session
|
\tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG` new-session
|
||||||
[[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
|
[[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
|
||||||
# Just run tmux, fixing the TERM variable if requested.
|
# Just run tmux, fixing the TERM variable if requested.
|
||||||
else
|
else
|
||||||
\tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config`
|
\tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG`
|
||||||
[[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
|
[[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue