diff --git a/modules/tmux/README.md b/modules/tmux/README.md index 9a15be09..15e04ff6 100644 --- a/modules/tmux/README.md +++ b/modules/tmux/README.md @@ -30,6 +30,18 @@ in *tmux.conf*: set-option -g destroy-unattached [on | off] +#### OSX iTerm2 Integration + +iTerm2 offers significant integration with tmux. This can be enabled by adding the following line to *zpreztorc*: + + zstyle ':prezto:module:tmux:iterm' integrate 'yes' + +See more information on iTerm2 and tmux integration on the following pages: + +[iTerm2 Download page](http://iterm2.com/downloads.html) + +[iTerm2 and tmux Integration](https://code.google.com/p/iterm2/wiki/TmuxIntegration) + Aliases ------- diff --git a/modules/tmux/init.zsh b/modules/tmux/init.zsh index 29b547f3..e1bb1467 100644 --- a/modules/tmux/init.zsh +++ b/modules/tmux/init.zsh @@ -16,12 +16,18 @@ fi # # Auto Start # +ITERM_INTEGRATION= +if ([[ $TERM_PROGRAM = iTerm.app ]] && \ + zstyle -t ':prezto:module:tmux:iterm' integrate \ +); then + ITERM_INTEGRATION=-CC +fi if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" ]] && ( \ ( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' remote ) || ( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' local ) \ ); then - tmux start-server + tmux start-server # Create a 'prezto' session if no session has been defined in tmux.conf. if ! tmux has-session 2> /dev/null; then @@ -32,7 +38,7 @@ if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" ]] && ( \ fi # Attach to the 'prezto' session or to the last session used. - exec tmux attach-session + exec tmux $ITERM_INTEGRATION attach-session fi #