How to automatically restore window arrangement from last time in iTerm?
Solution 1:
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.
Solution 2:
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.
Solution 3:
In 2019 (iTerm v3.2.9), what works for me is:
Save your current arrangement by clicking CMD + shift + S (or go Window -> Save Window Arrangement.
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.