问题
how does one "undo close-tab" in terminal? And quite related to it, is it possible to remember a session of tabs in terminal?
I mean (alike Firefox) if I close all tabs in a particular terminal window, how do I open with same the next day?
Its really useful to remember the terminal session for people like me who use multiple tabs a lot, and do not wish to start the next day with remembering what (and whereall) one was working, when one left the desk the day before.
In mouse right-click menu of gnome-terminal, one could easily (and I have) mistakenly click close tab instead of 'Copy'and lost track of what and where one was before selecting the text selected. In this case, undo closed-tab will serve a great purpose (available in Firefox already)
Thanks!
--V
回答1:
For the gnome terminal, you can use
gnome-terminal --profile=〈your profile〉 --save-config=〈file〉
I launch it as a background task to save the terminal state periodically.
回答2:
"termit" can save sessions and is scriptable in lua: https://github.com/nonstop/termit/wiki I don't know about an "undo close tab" feature, though.
For reference, my termit lua config can be found here: https://github.com/thet/dotfiles-termit
回答3:
On Linux, gnome-terminal
is able to load multiple tabs with different working directories. Like termit (which is much more flexible due to it's lua scripting interface), it doesn't have a "undo close tab" feature.
Open Gnome terminal with multiple tabs, each one in another working directory: gnome-terminal --tab --working-directory=/home --tab --working-directory=~ --tab --working-directory=/opt
.
Open Gnome terminal with multiple tabs and one base working directory: gnome-terminal --working-directory=/home --tab --tab --tab
.
For more options do: gnome-terminal --help-all
.
回答4:
The gnome terminal doesn't have such features, but if you're open to change you could try konsole, it has some nice 'save session' options you could find helpful, though nothing about re-opening accidentally closed tabs, as far as I know.
The other thing, if you're particular about your desktop, is that KDE's konsole might not fit all too well within Gnome.
来源:https://stackoverflow.com/questions/6048474/how-to-remember-multiple-tabs-session-in-terminal-alike-ff-session-manager