robbyrussell/oh-my-zsh — pull request #2444 by andschwa (2014-01-18 22:00:01+00:00)
Title: Tmux iTerm integration

As per issue #1903, this actually fixes the iTerm integration. No more weird crashing.

Really I should just refactor this whole plugin, but it'll have to wait until spring break probably, or for someone to ask.

As before:
> Essentially, if ZSH_TMUX_ITERM2 is set to true, the tmux plugin adds the option -CC to tmux whenever it is invoked. Enabling this also disables the loading of any "$HOME/.tmux.conf" configuration file, as they are not yet supported.

Tested working with AUTOCONNECT and AUTOQUIT.

The trick was instead of `tmux attach || tmux new` (which would fail because tmux attach, on failing to attach, itself tries to start the server) to check of it can attach with `tmux has`, and if so, attach, if not new session.