lxde / lxterminal

VTE terminal emulator written in GTK
GNU General Public License v2.0
159 stars 55 forks source link

feature request: have a option for "Restore previous session" #86

Open gabrielxfs opened 4 years ago

gabrielxfs commented 4 years ago

Every daily work I open my browser and enjoy this feature of this decade - "restore previous session" - for the sake of web development and practicality. But I not enjoy this feature when is to start the terminal emulator. In that case I have to reopen a series of tabs and change directories and start a bunch of developing services. In this way, would be nice to have this feature.

Trying to not just being requestful I ask some relevant question:

FinboySlick commented 4 years ago

I think it's an interesting feature though I am not entirely sure of how it could be implemented from within lxterminal itself. I'd love to hear your ideas if you go for option 2 however. And of course, you are fully welcome to contribute your code back to lxterminal if you do manage to implement it in a way that doesn't break things.

I think a sane way to do it would be to adapt the command line flags of lxterminal in two key ways:

1- allow multiple "--working-directory=" parameters, each of which would spawn a tab. 2- add a '--savestate' command line that would output one line for each window looking like this: --geometry=x --working-directory="" ... --working-directory="" ... --geometry=x --working-directory="" ... --working-directory=""

Then you could do 'lxterminal --savestate > /home/mystatefile' to save a session and 'xargs -f "/home/mystatefile" lxterminal' to restore a session, putting those in a script or desktop shortcut for convenience.

rysson commented 2 years ago

1- allow multiple "--working-directory=" parameters, each of which would spawn a tab.

And tab name options will be nice: --working-directory=/tmp --tabs=foo,bar --working-directory=/usr --tabs=baz → 3 tabs (two in /tmp and one in /usr)

And allow empty tab name as default name (like empty string in Ctrl-Shift-I) instead of omit tab like now. --tabs=1st,,3rd, → 4 tabs with names: 1st, default, 3rd, default