When session restoration is enabled, iTerm2 does not save colors set by the shell. More specifically, I'm using https://github.com/chriskempson/base16-shell to set my shell colors. It would be neat if this was saved between sessions.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
I believe I'm having the same issue. I have set a color preset (CMD-i -> colors -> Load Preset), colors look fine in my current terminal. Then went to the General tab and did "Copy current settings to selected Profile" while the Default profile was selected. Upon starting a new terminal or opening a new tab, colors are not applied.
In a new tab, if I simply open preferences and click "Use selected profile" while the Default profile is selected, colors are applied as expected.
It's as if iTerm would not apply colors properly when a profile is loaded by iTerm itself but when I load it manually it's fine.
Even if I do "Open new tab with current profile" the new tab does not load the color preset properly. If I re-apply the profile manually it's OK.
base16-shell/base16-colors.light.sh (background turns white now)
Cmd-Q to quit iTerm2
Relaunch iTerm2
When it comes back, the window's contents are restored (because I have System Prefs > General > Close windows when quitting an app turned off) and the background is white.
@jfchevrette it sounds like you're doing it right, would you mind sending a screencast? Maybe there's some subtlety I'm missing in the description. When I follow these steps it works for me.
You can restore your old prefs by going to Prefs > General and turn on Load preferences from a custom folder or URL. Set the URL to https://gitlab.com/gnachman/iterm2/uploads/3c7b4633d4c406a799fd26ff6fb8dc81/com.googlecode.iterm2.plist. Relaunch iTerm2 and your settings will be restored to what you uploaded. You can then uncheck Load preferences from a custom folder or URL and they will remain.
One possibility is that the app never gets a chance to save its window state unless another app becomes active (e.g., by pressing cmd-tab) after changing the colors. This is a silly limitation of the OS. Is it possible that this is the issue?
So it turns out that the script mentioned above, is set in my .zshrcto execute upon starting a shell. Commenting this out, starting a new shell, running the script manually to set the colors (which works), then quitting and restoring iTerm, does not keep the colors. Note though, that I get the "Session Restored" message and my sessions are in the right directories.
This is a good observation. We do not save and restore the full color map with window state, but we should since the goal is to preserve your state as completely as reasonably possible.
username-removed-55954Changed title: Customized colors set by shell not saved between sessions → Save & Restore color map with session state so customized palettes are properly preserved on restart.
Changed title: Customized colors set by shell not saved between sessions → Save & Restore color map with session state so customized palettes are properly preserved on restart.