Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Can I save tabs on exit in my iTerm 2, so I don't have to open same directories again after restart?

Like Chrome does, for example.

I couldn't find such option in settings. Maybe "Arrangements" is what I want, but it seems that it requires me to explicitly save tabs.

share|improve this question
    
iTerm 2 will open your saved Window Arrangements if you need that and don't like iTerm or Terminal.app on Lion. It works on Snow Leopard as well. –  bmike Aug 18 '11 at 19:40
    
ouch, I had no idea that iTerm 2 is something different from iTerm. I used iTerm 2. Can it save Window Arrangement on exit? I couldn't find out how –  valya Aug 18 '11 at 20:03
1  
You have to explicitly save the settings from my brief read of the FAQ - we'll see if anyone here knows for sure now that the question is razor sharp :-) Nice edits. –  bmike Aug 18 '11 at 20:05
    
iTerm2 has no support for reopening directories. This ticket can be used to track the implementation: code.google.com/p/iterm2/issues/detail?id=2775 –  Jörn Zaefferer Sep 16 at 22:00

3 Answers 3

You can Save and Restore Window Arrangement with ⇧ ⌘ S and ⇧ ⌘ R options under the Window screen in iTerm2

You can start the default Arrangement Option to enable are at Preferences -> General -> Startup -> Open default window arrangement .

You can add arrangements with the ⇧ ⌘ S and manage them under Preferences -> Arrangements tab .

iTerm Window Options

share|improve this answer
    
the one detail that was important for me here: first arrange windows like you want to have them, then hit ⇧⌘s and save as 'Default' (without the quotes, capitalized). the exact spelling is also shown on the Window > Restore Window Arrangement submenu. any other spelling will save the arrangement alright but not restore it on iTerm restart. –  flow Oct 20 '13 at 13:52
    
This does not answer the original question of "Can I save tabs on exit in my iTerm 2, so I don't have to open same directories again after restart?" –  Jeremy Lee Jul 15 at 17:56

Coming in quite late, but you should first create some profiles and then use Command - Option/Alt - Shift H (H is for horizontal split; or swap in V for vertical split). It will show you a list of your profiles and you can then add those to your split. Once you build the setup you like just like Sairam did above.

Here's a vid explaining: iterm2 Profiles and Window Arrangements.

share|improve this answer

It's still not exactly what you want, but since you can check the $ITERM_SESSION_ID environment variable to see which panel you are in, by combining this with a saved window arrangement, you can have each of your panel to start with different initial path, or just anything you would like to run by default.

For example, my saved windows arrangment is two tabs with two panels in the first tab. So I will have $ITERM_SESSION_ID=w0t0p0 for the first panel in the first tab, $ITERM_SESSION_ID=w0t0p1 for the 2nd panel, and $ITERM_SESSION_ID=w0t1p0 for the single panel in the 2nd tab. 'w' stands for window, 't' for tab, and 'p' for panel. I check these variables in my .zshrc, and run Vim in the w0t0p0, iPython in the w0t1p0, respectively.

share|improve this answer

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.