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
To load it back:
After playing around with bash I created following script which stores tab names into file
To assign names properly you have to run it from first tab of your terminal. Loading same as before:
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 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.
I found a way to do it that I think is faster.
On my .bashrc file I placed:
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!!