Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: persistent xterm sessions



 Gordon Marx wrote: 
> Tom wants his _local_ xterm (or xterm-alike) sessions to persist 
> across a reboot. 

Exactly. I'd like as much as possible to persist across an X restart, 
and at least the xterm tabs/windows + command history to persist across 
a reboot. Most xterms are sitting idle at a command prompt, so 
preserving running processes is not a priority. I'd be more interested 
in preserving the scrollback history. 


Gregory Boyce wrote: 
> Migrating a running process from one system to another would require 
> being able to take a snapshot of the program's running state in order to 
> replicate it on another system. Seems like you should be able to write 
> that state to local disk for recovery after a reboot. 

Yes, that's yet another approach. Between this and hibernation, it seems 
the really hard part has been solved. But there still could be 
substantial work in integrating this technology into something 
convenient to use, like an enhanced xterm. 

For now, I'd just like to preserve the more basic shell environment 
across reboots. 


David Rosenstrauch wrote: 
> Konsole also has the nice feature of being able to save the set of 
> currently open tabs to a "session profile" file, and then reload that 
> profile later (by typing "konsole --profile <profile-name>").  The 
> profile appears to save numerous settings of each open console, 
> including title, color schema, tab icon, working directory, choice of 
> shell command, etc., as well as overall app settings such as window 
> size. 

This sounds quite promising, though I'm not sure it is really all that 
different from the existing capabilities provided by GNOME's Terminal, 
which does everything you list, except provide a field to set the 
working directory. (I'm not sure if that is transparently preserved, or 
if you'd have to use its "custom command" feature to set the working 
directory.) 

I did fairly limited testing with preserving GNOME Terminal sessions via 
GNOME built-in session saving facility. As I recall, after a restart, 
only a portion of the xterms restarted, and on a second restart, none of 
them did. In addition, I don't think any of the internal shell state, 
like the working directory, was preserved. Using a custom profile for 
each would probably address that. 

Is Konsole an app. that can be ran under GNOME if the dependent KDE 
libraries are installed? 


> I think it might also be possible to then go into the session profile 
> file...and edit it to do things like execute custom scripts for each 
> console, set a custom $HISTFILE, etc... 

In GNOME's Terminal there is a field in the profile properties dialog 
for setting a custom command, so that's straightforward. 

The question is really how to automate all this so you don't have to do 
a bunch of custom configuring for each xterm window. I want to be able 
to open an arbitrary xterm window and have as much as possible about it 
persist across at least an X restart, if not a reboot, without having to 
take any explicit action. At most I want to set the title. 

If I can extract the title at the shell level, I can probably create a 
"startup script" that gets called by a generic profile to create or load 
a specific history file, and go to the last recorded CWD. 

Short of using screen, or hacking the xterm code, I'm not sure how to 
persist the scrollback buffer. If screen played more nicely with GNOME 
Terminal, it would probably be an acceptable solution. Then the startup 
script would first try and reattach to a named screen session, otherwise 
create a new one, load the history, and restore the CWD. So you'd loose 
scrollback on reboot, but the rest would get preserved. 

Hacking screen to save/restore the scrollback buffer to/from disk might 
be a fairly small project, though last I looked screen has ceased 
development, so there won't be much of a support community to assist in 
that kind of project. 

  -Tom 

-- 
Tom Metro 
Venture Logic, Newton, MA, USA 
"Enterprise solutions through open source." 
Professional Profile: http://tmetro.venturelogic.com/

-- 
This message has been scanned for viruses and 
dangerous content by MailScanner, and is 
believed to be clean. 

_______________________________________________ 
Discuss mailing list 
[hidden email] 
http://lists.blu.org/mailman/listinfo/discuss
 


BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org