terminal
terminal copied to clipboard
Terminal not remember tabs after system restart
What Happened
When you open terminal and some tabs, then when you close manually terminal, the tabs will be restored, but when you not close manually terminal but perform system restart, then the tabs will not be restored on next terminal start.
Expected Behavior
After system restart terminal tabs should be restored.
Steps to Reproduce
- Open terminal with some differents tabs
- Perform system restart without closing terminal
- After restart open terminal and non of tabs should be restored
Platform Information
elementary OS 6.0
Thanks for the report. This longstanding issue is a consequence of the way the session is closed and has been raised elsewhere (https://github.com/elementary/wingpanel-indicator-session/issues/27). It is a general problem not specifically Terminal. Until a fix is developed, the only workround is to manually close all windows you want to restore before closing the session.
I'll leave this open, I think as it could be "fixed" by having Terminal continually save its state rather than do it on closing the window. There is some precedent for this in Code continually saving documents as they are edited.
The issue linked dates back to 2017, however, in an elementary OS 5.1 installation that I have, the terminal tabs are remembered correctly. I have to turn off the computer issuing a shutdown
command there so I never close terminal. Similarly Files tabs are remembered correctly. Note Hera (5.1) was released late 2019.
Now in a 6.1 installation, I am facing these problems.
Please check that you have History enabled in the Settings Security & Privacy plug. If this is disabled then Terminal now honors that setting and does not restore previously used locations. Also check the result of gsettings get io.elementary.terminal.settings remember-tabs
in a terminal.
History was disabled. I enabled it and ensured the property value is true
. Sadly tabs are not restored after a computer restart. So basically it's the same behavior as in the issue description
Workaround: when I open Terminal with the hotkey (Super+T, but I might have changed it), my tabs are correctly restored (almost, the order can be wrong). On OS7, I can't see Terminal in the data sources list in Security & Privacy / History.
There are four conditions to be met for the app state to be remembered:
-
The app is closed "normally" i.e. by clicking on the close button or pressing
<Ctrl><Shift>Q
or closing the last tab. The state is not remembered if the app closes by ending its process e.g. by logging out or directly -
The app setting
io.elementary.terminal.settings.remember-tabs
istrue
. This is the default and this setting is not exposed in the Terminal UI so this should be the case . Check with the command linegsettings get io.elementary.terminal.settings remember-tabs
. -
The global setting
org.gnome.desktop.privacy.remember-recent-files
istrue
. This depends on the state of the switch in the Privacy & Security Settings plug. Check withgsettings get org.gnome.desktop.privacy remember-recent-files
. -
The tab must have a valid shell location
Please advise if you are still experiencing the issue when all these conditions are met.
If you check the setting io.elementary.terminal.saved-state.tabs
after opening terminal and the expected tabs are not restored this would indicate whether the problem was in saving or in restoring the state.
Thanks for the details. My settings are as described. The mentioned workaround seems to work for me persistently (both on OS 6 and 7, although I did not try to deliberately reproduce and debug the problem), so I thought I'd just share it.
@volfpeter So you are getting different results depending on how you open Terminal? That's strange. All methods should be executing io.elementary.terminal
. Have you made any changes to the default terminal?
It occurred to me there is one other situation where tabs are not restored. That is if there is already an instance of Terminal running. Tabs are only restored for the first window.
Tabs are also not restored if Terminal is launched with the -x
option.
Yes, it definitely feels like that, but as I mentioned, I did not try to deliberately look into this. I default to Super+T, and occasionally start Terminal from the Dock just to see what happens :) No changes at all, I'm running stock OS7.
I am inclined to close this as the original issue is not something Terminal can fix - it is a system level thing. Please open new issues relating to Terminal specific things if appropriate.