Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Re: idea for new feature (was: Re: sticky-note and zle bindings)

On Sat, 7 Jun 2008, Robert Knight wrote:

Hi folks,

I'd like to implement my part of this quite soon.  So here is a more
concrete proposal:

I couldn't find the original thread (more than two months ago?), so I'm not sure what I'm suggesting below covers everything.


Digging back through my mail from users, something which would earn much love from sysadmins would be if they could save the state of their terminal, with 10-20 connections to various machines via SSH and later restore that again instantly - including as much state as possible on the remote end.

Have you tried 'screen'? I think it's a GNU project now (or maybe always was). It does basically what you're looking for. I use screen on most boxes I SSH to. And I run it on my own machine for long-running processes that I might want to come back to.

One of my startup files is even .zsh_screen:
[ "$TERM" = "screen" ] && other=Other || other=Running
S=$(screen -ls | perl -lnwe 'BEGIN{$sty=$ENV{STY}||"ZZZ";} print if /^\s/ and /\S/ and !/\b\Q$sty\E\b/')
[ -n "$S" ] && printf '%s screens:\n%s\n' $other $S

(basically munges the output of screen -ls to cut some lines and not show the current session)

On a machine where I have troubles (from some locations) with timeouts via SSH, I have it automatically start a screen session, and it tries to reattach if there's one that's doen.

On another, I have the command-line mercurial daemon and two command-line trac daemons running in screen sessions. If I SSH in and reattach, it's as if I never left.


Messages sorted by: Reverse Date, Date, Thread, Author