save open terminal windows

Soldato
Joined
29 Oct 2005
Posts
3,298
Hi guys,

I am doing a project at the moment and I have about 6 terminal windows I need to use. However being stupid I mashed a shortcut earlier that apparently closed all the terminal windows! To prevent this from happening again is there a way I can save all current terminal windows as a state so i can launch them all again at once?

Thanks

Daven
 
GNU screen is perfect for this.

It's almost impossible to accidentally nuke the session.

I have around 60 linux machines on one of the test stands at work, and a few other command line systems. You can bet I use screen.

It's also multiplayer, which looks a little spooky if you weren't expecting it.
 
Last edited:
Ok I am now using screen, however I don't think it will save my session in the case of a system crash (I am on a virtual machine so this often happens!) is there a way I can save my terminal windows and their working directories as a session that I can load up later on - I don't require histories to be saved but it could be handy if possible.

Thanks
 
Install screen on the machine you're connecting to, rather than from.

A screen session inside an ssh session, rather then an ssh session inside a screen session.
 
I am using a virtual machine on my desktop pc, there are no ssh sessions. The terminals are just in various directories on the virtual machine executing tasks like compile, copy, unzip etc.

I was hoping there would just be a way to save a terminal in a certain directory.

Hmm I might try making a script that does it for me :)
 
If they're always the same directories you want to go back to you could write a script to open gnome-terminal in the appropriate directories at login.

The "automatically remember my running applications box" in Preferences -> Sessions -> Options might already do this in Gnome. Test it.
 
I tried the remember running applications, but it only remembers that a terminal was open. I think a script will be the best way forward :)

thanks guys
 
You're never going to keep a session open if you take the virtual machine down.

You can have screen record all text to a file. But you won't be able to get the session back.
 
Back
Top Bottom