In Mac, if I have a few Terminal windows open and I restart the computer or quit Terminal, the windows that were open last are opened again with their working directories and command histories retained.

Is there a way to similarly reopen Ubuntu Terminal windows?

  • Which desktop environment are you using? Unity (the Ubuntu default) or something else? And which terminal emulator are you using? (I don't know what the Ubuntu default is these days — gnome-terminal?) – Gilles 'SO- stop being evil' Apr 5 '16 at 23:54

Technically it depends upon the chosen desktop. The question has been asked here and there without any good answers. For gnome-terminal, a commonly proposed solution is adding the --save-config option, e.g.,

gnome-terminal --save-config=/home/whatever/foo

There is also the dconf-editor which might be effective, depending on what applications you use.

In either case, those would only restore a shell to a given working directory; restoring programs running within the shell seems to be glossed over generally (except for the rare case where the application also has session support).

Further reading:

  • Option “--save-config” is no longer supported in this version of gnome-terminal (3.28.2) – ChrisW Aug 16 at 12:03

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.