Difference between tmux and shell split options on iTerm2?

I currently switched to iTerm2 + VIM for my dev environment. I noticed that the last version of iTerm2 supports tmux and there were people using tmux to split the window into several sessions. I also noticed that iTerm2 has options out of the box to split the window into several sessions. You can split as many sessions as you want vertically and horizontally by just using CMD+D for example. So to me it seems that you can accomplish the same functionality with those options. I could be totally wrong.

My questions is: Is there a difference/benefit by using tmux over the splitting options on iTerm2?


if you close iterm2 then the shells attached to that instance of iterm2 are destroyed / closed as well. process-hierchy of this situation:

iterm2
  +---- shell
  +---- shell
  +---- shell

if you close the iterm2 which holds tmux, then tmux and the shells inside that tmux instance keep running. you can later reattach to that tmux instance (thats essentially how folks work on remote-servers in case the connection drops) and get back the situation as it was before you closed the iterm2. process-hierarchy of this situation:

iterm2
  +---- tmux
          +---- shell
          +---- shell
          +---- shell

to quote from tmux directly:

tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.

an older project providing basically the same functionality is screen


Accepted answer is great and is my favorite thing about tmux, but often overlooked is multiple clients can be attached to each tmux session. So, one or more users can connect to a tmux session from different computers and they share the same information on the window.


There is also now a tool called iTermocil that brings the functionality of laying out windows and panes, and running pre-configured commands natively to iTerm.

Disclaimer: I am the author this tool (for the exact functionality described in the question).