Difference between tmux and shell split 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.