diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2019-11-21 09:04:33 -0700 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2019-11-21 09:04:33 -0700 |
commit | 9c851a9b820a70b8d23dee0b51220d009e749cec (patch) | |
tree | c753688ce9392dc24043cb2f3072d0fec9faab7c /plugins/tmux | |
parent | 1ffd2849fc056dced0c80a9ed8905f29ff9827a5 (diff) | |
parent | 1c98b9cc38d34647f1d6357919a0f4e1d5ebd4cd (diff) | |
download | zsh-9c851a9b820a70b8d23dee0b51220d009e749cec.tar.gz zsh-9c851a9b820a70b8d23dee0b51220d009e749cec.tar.bz2 zsh-9c851a9b820a70b8d23dee0b51220d009e749cec.zip |
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/tmux')
-rw-r--r-- | plugins/tmux/README.md | 3 | ||||
-rw-r--r-- | plugins/tmux/tmux.extra.conf | 2 | ||||
-rw-r--r-- | plugins/tmux/tmux.plugin.zsh | 11 |
3 files changed, 12 insertions, 4 deletions
diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index 427119d3d..1e25af38f 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -1,6 +1,6 @@ # tmux -This plugin provides aliases for [tmux](http://tmux.github.io/), the terminal multiplexer. +This plugin provides aliases for [tmux](https://tmux.github.io/), the terminal multiplexer. To use it add `tmux` to the plugins array in your zshrc file. ```zsh @@ -37,3 +37,4 @@ The plugin also supports the following - | `ZSH_TMUX_ITERM2` | Sets the `-CC` option for iTerm2 tmux integration (default: `false`) | | `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `screen`) | | `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `screen-256color` | +| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`) |
\ No newline at end of file diff --git a/plugins/tmux/tmux.extra.conf b/plugins/tmux/tmux.extra.conf index beffd380c..c4aaad0b0 100644 --- a/plugins/tmux/tmux.extra.conf +++ b/plugins/tmux/tmux.extra.conf @@ -1,2 +1,2 @@ set -g default-terminal $ZSH_TMUX_TERM -source $HOME/.tmux.conf +source-file $ZSH_TMUX_CONFIG
\ No newline at end of file diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 2f3c3e79d..dad3db578 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -34,6 +34,8 @@ alias tkss='tmux kill-session -t' # Tmux states this should be screen-256color, but you may need to change it on # systems without the proper terminfo : ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color} +# Set the configuration path +: ${ZSH_TMUX_CONFIG:=$HOME/.tmux.conf} # Determine if the terminal supports 256 colors if [[ $terminfo[colors] == 256 ]]; then @@ -43,7 +45,8 @@ else fi # Set the correct local config file to use. -if [[ "$ZSH_TMUX_ITERM2" == "false" && -e "$HOME/.tmux.conf" ]]; then +if [[ "$ZSH_TMUX_ITERM2" == "false" && -e "$ZSH_TMUX_CONFIG" ]]; then + export ZSH_TMUX_CONFIG export _ZSH_TMUX_FIXED_CONFIG="${0:h:a}/tmux.extra.conf" else export _ZSH_TMUX_FIXED_CONFIG="${0:h:a}/tmux.only.conf" @@ -65,7 +68,11 @@ function _zsh_tmux_plugin_run() { # If failed, just run tmux, fixing the TERM variable if requested. if [[ $? -ne 0 ]]; then - [[ "$ZSH_TMUX_FIXTERM" == "true" ]] && tmux_cmd+=(-f "$_ZSH_TMUX_FIXED_CONFIG") + if [[ "$ZSH_TMUX_FIXTERM" == "true" ]]; then + tmux_cmd+=(-f "$_ZSH_TMUX_FIXED_CONFIG") + elif [[ -e "$ZSH_TMUX_CONFIG" ]]; then + tmux_cmd+=(-f "$ZSH_TMUX_CONFIG") + fi $tmux_cmd new-session fi |