19ae0b576c4fd0c0c4af1a5c491df867fdce39a4

Author
Josh Matthews <josh@jmatthews.us>
Committer
Josh Matthews <josh@jmatthews.us>
Date

Message

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.

Diff

 1diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
 2index ea6b4d26cc27654878447fdfcbcc72d1adb4e6cb..465f5b053696789317b2854c20764d585f337424 100644
 3--- a/plugins/tmux/tmux.plugin.zsh
 4+++ b/plugins/tmux/tmux.plugin.zsh
 5@@ -35,17 +35,14 @@ if which tmux &> /dev/null
 6 		export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR
 7 	fi
 8 
 9-	# Local variable to store the local config file to use, if any.
10-	local fixed_config=""
11-
12 	# Set the correct local config file to use.
13 	if [[ -f $HOME/.tmux.conf || -h $HOME/.tmux.conf ]]
14 	then
15 		#use this when they have a ~/.tmux.conf
16-		fixed_config="$zsh_tmux_plugin_path/tmux.extra.conf"
17+		export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.extra.conf"
18 	else
19 		#use this when they don't have a ~/.tmux.conf
20-		fixed_config="$zsh_tmux_plugin_path/tmux.only.conf"
21+		export _ZSH_TMUX_FIXED_CONFIG="$zsh_tmux_plugin_path/tmux.only.conf"
22 	fi
23 
24 	# Wrapper function for tmux.
25@@ -58,11 +55,11 @@ if which tmux &> /dev/null
26 		# Try to connect to an existing session.
27 		elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]
28 		then
29-			\tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config`  new-session
30+			\tmux attach || \tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG`  new-session
31 			[[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
32 		# Just run tmux, fixing the TERM variable if requested.
33 		else
34-			\tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$fixed_config`
35+			\tmux `[[ "$ZSH_TMUX_FIXTERM" == "true" ]] && echo '-f '$_ZSH_TMUX_FIXED_CONFIG`
36 			[[ "$ZSH_TMUX_AUTOQUIT" == "true" ]] && exit
37 		fi
38 	}