sorin-ionescu/prezto — pull request #558 by NaleagDeco (2014-02-17 23:24:33+00:00)
Title: 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 shouldn't attempt to autostart a tmux/screen session.

See issue #541

Reproduction steps: Launch Emacs.app in OSX or a GUI Emacs via Ubuntu's Unity GUI. Previous to the fix, Emacs won't successfully perform a M-x shell. With this fix, Emacs should successfully launch a shell.