lxterminal icon indicating copy to clipboard operation
lxterminal copied to clipboard

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

Open gabrielxfs opened this issue 3 years ago • 2 comments

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:

  • Fast thinking: that functionality will deviate the philosophy and principles of the project by consumption of memory or others resources?
  • Can I make a fork, implement it (effortfully following the pattern of the project) and make a Pull Request to in some way contribute to the project?

gabrielxfs avatar Aug 12 '20 22:08 gabrielxfs

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=<win1_x_size>x<win1_y_size> --working-directory="<cwd_of_win1_tab1>" ... --working-directory="<cwd_of_win1_tabN>" ... --geometry=<winN_x_size>x<winN_y_size> --working-directory="<cwd_of_winN_tab1>" ... --working-directory="<cwd_of_winN_tabN>"

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.

FinboySlick avatar Aug 13 '20 19:08 FinboySlick

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

rysson avatar Mar 13 '22 15:03 rysson