Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal not remember tabs after system restart #616

Closed
zimnyd opened this issue Aug 22, 2021 · 12 comments
Closed

Terminal not remember tabs after system restart #616

zimnyd opened this issue Aug 22, 2021 · 12 comments
Labels
Status: Duplicate Already reported elsewhere

Comments

@zimnyd
Copy link
Contributor

zimnyd commented Aug 22, 2021

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

  1. Open terminal with some differents tabs
  2. Perform system restart without closing terminal
  3. After restart open terminal and non of tabs should be restored

Platform Information

elementary OS 6.0

@jeremypw jeremypw added the Status: Duplicate Already reported elsewhere label Aug 22, 2021
@jeremypw
Copy link
Collaborator

jeremypw commented Aug 22, 2021

Thanks for the report. This longstanding issue is a consequence of the way the session is closed and has been raised elsewhere (elementary/quick-settings#42). 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.

@jgomer2001
Copy link

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.

@jeremypw
Copy link
Collaborator

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.

@jgomer2001
Copy link

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

@volfpeter
Copy link

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.

@jeremypw
Copy link
Collaborator

There are four conditions to be met for the app state to be remembered:

  1. 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

  2. The app setting io.elementary.terminal.settings.remember-tabs is true. This is the default and this setting is not exposed in the Terminal UI so this should be the case . Check with the command line gsettings get io.elementary.terminal.settings remember-tabs.

  3. The global setting org.gnome.desktop.privacy.remember-recent-files is true. This depends on the state of the switch in the Privacy & Security Settings plug. Check with gsettings get org.gnome.desktop.privacy remember-recent-files.

  4. The tab must have a valid shell location

Please advise if you are still experiencing the issue when all these conditions are met.

@jeremypw
Copy link
Collaborator

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.

@volfpeter
Copy link

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.

@jeremypw
Copy link
Collaborator

@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.

@jeremypw
Copy link
Collaborator

Tabs are also not restored if Terminal is launched with the -x option.

@volfpeter
Copy link

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.

@jeremypw
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Duplicate Already reported elsewhere
Projects
None yet
Development

No branches or pull requests

4 participants