I have a Terminal window with a dozen named tabs open.
I would like to save the current configuration and have it restored with names and directories.
Is there a way to do this?
I have a Terminal window with a dozen named tabs open.
I would like to save the current configuration and have it restored with names and directories.
Is there a way to do this?
To save configuration into
/tmp/cfg
:To load it back:
UPDATE
After playing around with bash I created following script which stores tab names into file
/tmp/test
as well:To assign names properly you have to run it from first tab of your terminal. Loading same as before:
EXPLANATION:
I can use following to get tab name:
I can use following to jump to next tab:
I'm getting number of tabs after grepping configuration file I saved before:
So I can iterate over tabs inside a loop. I have to add "Title=titlename" entry for each tab configuration section in file saved before. To do so, first I'm creating an array of line numbers where I'll be adding lines.
I'm adding "Title=titlename" line inside of loop iterating over tabs:
An alternative is to just use Byobu. Press F2 to open new terminals inside it. Use F3 and F4 to switch left and right between terminals.
Close the GUI window anytime you want. When you reopen Byobu all your terminals are restored :)
I've also looked for that feature in Gnome terminal but couldn't find it. The best option I found so far is to use konsole. It allows you to bookmark your tabs, so that you can get back to them by choosing them from a bookmarks menu. I hope this helps.
I found a way to do it that I think is faster.
Type:
I made an alias with this command and it worked pretty fine for me. I just type
workflow
and a Terminal appears with 3 tabs and the titles that I chose in the profile definition that are placed into the tabs.On my
.bashrc
file I placed:I tried the below options after restoring the saved settings and the Title is also restored properly.
This option avoid your initial title set to be overwritten.
Hope This helps and a great script indeed. Save a lot of time whenever u reboot and I can happily reboot my virtual box frequently.
Thanks!!
I Tried one more option,
I changed my default title for Terminal to use the Intital value in
~/.bashrc
, rather than changing the~/.profile
settings.If You do this, there is no need to change your Terminal Profile.
When you execute
gnome-terminal --load-config
all the tab names are restored properly. And you can also change as you like it and save the tabs again!!Screen or Byobu are my preferred methods of managing complex workflow in the terminal, and both allow saving your configurations.
Hyper (https://github.com/zeit/hyper) is a good cross platform alternative written in JavaScript and bundled with Electron.
There's a PR that is going to add support for session save/restore out of the box: https://github.com/zeit/hyper/pull/945
tmux-resurrect
A little improvement to the existed script which also checks xdotool installed on system and adds variable for changing path