Reopen a last closed tab in gnome terminal

gnome-terminalterminal

Can we reopen an accidentally closed tab in gnome terminal? Assume the closed tab is the last closed one.

In firefox, we can use Ctrl-shift-t to do that. But I haven't found away in gnome terminal yet. Thanks.

Best Answer

Unfortunately, you cannot open old tabs in the Gnome-Terminal. Because Firefox is a web browser when you open a previous tab like that it just goes to the history file and goes to the website as the last entry. It is reloaded from the ground up.
The Gnome-Terminal does not activate/go to set pages, instead it is just an interface to the console so you cannot go to previous pages.
If you just want to have all the commands you had previously run ran again so you could be in a certain place with certain things set, you can go to you .bash_history file (sometimes it is called .history). This contains a list of all your previous commands and is how you can click the up arrow key to go through your command history. You can just copy-paste out of that with ctrl-shift-c and ctrl-shift-v in the gnome terminal.
If it something you want to run as a script to "set you up" in your previous state you can make a bash script out of the lines of history that you need.
If you want it to run every time bash launches then add those lines to the end of your .bahsrc file.

Related Question