tmux: do not auto-load tmux inside of Emacs/Vim
When Emacs and Vim are launched from outside of an interactive shell,
$TMUX and $STY are not set; check for Emacs and Vim environment
variables instead.
Diff
1diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
2index 4a79863896b21ffbeeedc94a5a61e7e905ad88bd..7ddf42099a42d09220c3cfa633e640fc5c7e91a5 100644
3--- a/plugins/tmux/tmux.plugin.zsh
4+++ b/plugins/tmux/tmux.plugin.zsh
5@@ -80,7 +80,7 @@ compdef _tmux _zsh_tmux_plugin_run
6 alias tmux=_zsh_tmux_plugin_run
7 8 # Autostart if not already in tmux and enabled.
9-if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" ]]; then
10+if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z "$EMACS" && -z "$VIM" ]]; then
11 # Actually don't autostart if we already did and multiple autostarts are disabled.
12 if [[ "$ZSH_TMUX_AUTOSTART_ONCE" == "false" || "$ZSH_TMUX_AUTOSTARTED" != "true" ]]; then
13 export ZSH_TMUX_AUTOSTARTED=true