Using iTerm2’s built-in integration with tmux

Dave Smith
5 min readApr 21, 2018

Have you ever had a dozen terminal windows open to a remote system you are working on only to be suddenly disconnected and have to start completely over? Or been so wrapped up in a project across multiple windows and hosts that you stayed at work way later than you were supposed to just so you wouldn’t lose your place and have to start over in the morning? By using a combination of iTerm2 and tmux, you can regain control of your workflow, lose your fear of the disconnect, and be much more productive.

iTerm2 is a very capable terminal application for MacOS. One of its best but probably least-used features is its native integration with tmux. Tmux is a terminal multiplexer. Simply put, this allows you to split one terminal session into many. This can be done by using different windows/tabs or splitting the screen vertically and horizontally multiple times until you have your ideal layout. But using tmux you can also disconnect and leave your sessions in tact, ready for you when you return, from another IP or even another computer.

Tmux can be a little daunting, but there’s a great introduction to it available here: https://hackernoon.com/a-gentle-introduction-to-tmux-8d784c404340

Manually, you could ssh into a remote host, then start tmux

--

--

Dave Smith

Cat herder, former pentester, Information Security professional, technology and shiny stuff enthusiast.