gnome-shell-extension-ddterm icon indicating copy to clipboard operation
gnome-shell-extension-ddterm copied to clipboard

Remember open tabs between sessions

Open tomyo opened this issue 4 years ago • 4 comments

Hi, awesome extension, good job!, I replaced Guake with ddterm recently because of better Wayland support and performance.

The only thing missing is for my tabs to be remembered when I log back in my session.

By remembered I mean: how many where open, and on what location each.

Since I can't find an option for this, nor issues, probably is a feature request.

I could give a try creating a MR if I get a bit of guidance...

Thanks!

tomyo avatar Sep 01 '21 13:09 tomyo

Yes, it's not implemented.

You'll need to save tab list somewhere when the window is being closed (or before the window is closed), and load it next time (if available).

Gtk.Application.query-end signal has been added recently for this purpose. However, it seems that Gnome apps don't use it actively.

Overall, ddterm is just a Gtk app, so session save/restore should be implemented like in any other Gtk app.

Writing a thorough guide will require time and effort similar to implementing the feature, so please ask specific questions if needed. However, I've never implemented a feature like this myself (at least in Gtk apps).

amezin avatar Sep 07 '21 05:09 amezin

Hi,

this is actually the only thing I am missing a bit after migrating to ddterm from guake recently. Apart from that for me ddterm beats it by all means. :+1:

I sadly have not experience at all in writing Gtk apps or well anything with frontend related. But I have one question: Would ddterm really need to use query-end to achieve a feature like this? Wouldn't it be easier to keep a file up to date on run time on opening/closing a terminal tab and load it on start?

For me keeping the actual terminal session isn't really important, but having the same tabs open with their last location would be neat.

justus-saul avatar Sep 07 '21 07:09 justus-saul

Wouldn't it be easier to keep a file up to date on run time on opening/closing a terminal tab and load it on start?

I see no reason to write to a file multiple times when you can do that only once.

ddterm alone won't make a noticeable difference, but if people start writing all software like this, it'll increase SSD wear and reduce battery run time.

If you need to access open tabs while ddterm is running - a D-Bus interface is likely a better solution https://github.com/amezin/gnome-shell-extension-ddterm/issues/79

amezin avatar Sep 07 '21 15:09 amezin

I see no reason to write to a file multiple times when you can do that only once.

ddterm alone won't make a noticeable difference, but if people start writing all software like this, it'll increase SSD wear and reduce battery run time.

One possible caveat I can offer: I noticed I was in need of this feature when another gnome extension either reloaded or crashed the top bar, and all of my tabs were gone. In the case of reloading, I imagine that (or another) Gtk signal could be used, but in the case of crashing, I think it would not. A manual "Save Defaults" option might cover that, though. 🤔

mpql avatar Dec 27 '21 13:12 mpql

Does anyone know a GNOME app that has session save and restore feature?

amezin avatar Sep 21 '23 22:09 amezin