Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

Thanks!

share|improve this question

1 Answer 1

up vote 7 down vote accepted

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

share|improve this answer
    
Thanks akira! that was my very first question on SU and received a great answer, just exactly what I needed! –  wonitta Mar 9 '12 at 7:29
    
Isn't the process hierarchy more like: iterm2 > shell > tmux client and tmux server > shell? So when you close iTerm, you close the tmux client but the server is still around. –  Henrik N Mar 18 '12 at 21:11
    
@HenrikN: iTerm2 might call the tmux-client "directly". you would get the same effect if you launch "exec tmux attach" or something similar. and yes, tmux consists of 2 parts. but that distinction does not improve the understanding why iterm2-splitting is different from tmux-splitting, does it? –  akira Mar 19 '12 at 7:31
    
@akira I just wanted to clear it up because you put tmux under iTerm, which perhaps makes it harder to see how tmux survives when the iTerm process exits. To me, the best way to understand that is to realize that the tmux server is independent of iTerm (but the client is not). But certainly, the fact that tmux and not iterm owns the split shells is a key point. –  Henrik N Mar 19 '12 at 8:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.