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

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

Open
gabrielxfs opened this issue Aug 12, 2020 · 2 comments
Open

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

gabrielxfs opened this issue Aug 12, 2020 · 2 comments

Comments

@gabrielxfs
Copy link

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?
@FinboySlick
Copy link
Contributor

FinboySlick commented Aug 13, 2020

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.

@rysson
Copy link

rysson commented Mar 13, 2022

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

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

No branches or pull requests

3 participants