14

I have two old Macs, both have iTerm2 installed and could automatically restore window arrangement (tabs with different directories and colors) from last time after launch. I forget what configuration I've made for both.

Now I'm setting up a new Mac with iTerm2, but could never get "automatically restore window arrangement from last time" working there.

What I've tried:

  1. Compared with the working ones, check and set the preferences one by one;
  2. Cloned the working "~/Library/Preferences/com.googlecode.iterm2.plist";
  3. Preferences -> Profiles -> General -> Working Directory -> Reuse previous session's directory (but I think this impacts when you open a new tab, not for launch);
  4. Menu -> Window -> Save Window Arrangement -> and save it as default. But in this case, every time if I launch from start, iTerm always restore fixed window arrangement from the save. I don't want to save any pattern, I just want restore whatever I have from last time.

All the things I've tried could not make it work. Could anyone tell me what should I do please? Thanks a lot.

iTerm version: iTerm2-1_0_0_20140112

  • One more hint: both of the working Macs, I haven't used any AppleScript, just checked some options in the preferences. – Jing Li Mar 8 '14 at 14:12
29

In iTerm2's preferences (Cmd + ,), change General > Startup from Open Default Window Arrangement to Use System Window Restoration Setting.

In System Preferences, turn off General > Close windows when quitting an app.

  • 1
    Thanks @George, that solves the problem! So the trick is to turn off one option in System Preferences which is outside app config. – Jing Li May 19 '14 at 5:49
  • In 2019, iTerm v3+ I had to just go to Preferences -> Arrangements and click "Set Default" on your created arrangement (save it first by clicking cmd+shift+S) – trainoasis Jun 27 '19 at 7:42
12

I wrote a program designed to solve this pain point for myself, which allows you to create pre-defined layouts of panes and commands (for different projects/setups etc.) and then load them in iTerm whenever you want.

It is called iTermocil, and you can download it (and the source code) via Github: https://github.com/TomAnthony/itermocil.

enter image description here

3

In 2019 (iTerm v3.2.9), what works for me is:

  1. Save your current arrangement by clicking CMD + shift + S (or go Window -> Save Window Arrangement.

  2. Now go to iTerm2 -> Preferences -> Arrangements -> select your arrangement in the list of arrangements -> Click "Set Default" at the bottom.

Now when you reopen iTerm at any point it will open your new arrangement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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