So I experienced tmux last week for not the first time but the “definitive time” where I actually played/studied it and configured it to my liking.

One of the key things I loved about it was the epic mouse integration for scrolling, selecting panes, and resizing panes:

#enable mouse support setw -g mode-mouse on set -g mouse-select-pane on set -g mouse-resize-pane on set -g mouse-select-window on

I also enabled the tmux plugin for oh-my-zsh which adds a few nice features, primarily allowing you to not have to type “attach”.

You can search google for sample configs if you’d like to fiddle more.

One key thing that you loose using tmux is the ability to use copy/paste efficiently since when you highlight something, that is registered at the tmux level, not the OS/iterm2 level. You can get around this by holding Alt/Option when selecting text. Note that this will select everything in the current pane and pane next to it as well since iterm sees all the tmux panes as one pane/window.

The other thing that would be nice is being able to use iterm2?s broadcast feature where you can enter a command that gets replicated on all your other panes. Except for again, this doesn’t work when using tmux since iterm doesn’t know about tmux’es panes.

So I did some searching and found out about iterm2?s actually pretty sweet tmux intergration!

How does this work? You actually utilize tmux as follows:

tmux -CC #start a new session spawning a new iterm window tmux -CC attach #reattach to that session which spawns the iterm window with everything the way it was

This is actually really cool because you are actually using tmux just like you would with multiple panes into different servers etc..but its all actually just a tmux session! What sucks here is that you have to keep the “tmux -CC” shell open (minimized works too) for iterm to keep its connection to tmux. You can’t really utilize it at all except for controlling the session.

So what makes this awesome? The paste and broadcasting features I spoke about earlier work perfectly since you using your tmux panes at the iterm level!

Blog Logo

Mario Loria


Published

Image

./scriptthe.net

Because 127.0.0.1 gets old after a while.

Back to Overview