From 7c33f7d24d4a89270ff8009c9c18fc6a44819806 Mon Sep 17 00:00:00 2001 From: Gaelan D'costa Date: Mon, 17 Feb 2014 17:57:34 -0500 Subject: [PATCH] Don't attempt to enter screen/tmux environment when in Emacs If launching Emacs from outside an interactive shell (say from Upstart, Gnome3, an OS X .app bundle), $TMUX and $STY won't be set. We shouldn't launch ssh/tmux when running emacs, because emacs can't handle the termcaps of such multiplexers. Emacs sets $INSIDE_EMACS and (on older versions) $EMACS, so if those are set we won't attempt to autostart a tmux/screen session. --- modules/screen/init.zsh | 2 +- modules/tmux/init.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/screen/init.zsh b/modules/screen/init.zsh index f10efb73..e6185402 100644 --- a/modules/screen/init.zsh +++ b/modules/screen/init.zsh @@ -15,7 +15,7 @@ fi # Auto Start # -if [[ -z "$STY" ]] && ( \ +if [[ -z "$STY" && ( -n "$INSIDE_EMACS" || -n "$EMACS") ]] && ( \ ( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:screen:auto-start' remote ) || ( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:screen:auto-start' local ) \ ); then diff --git a/modules/tmux/init.zsh b/modules/tmux/init.zsh index a59b259a..67374d94 100644 --- a/modules/tmux/init.zsh +++ b/modules/tmux/init.zsh @@ -16,7 +16,7 @@ fi # Auto Start # -if [[ -z "$TMUX" ]] && ( \ +if [[ -z "$TMUX" && ( -n "$INSIDE_EMACS" || -n "$EMACS") ]] && ( \ ( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' remote ) || ( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' local ) \ ); then