zsh-users
 help / color / mirror / code / Atom feed
From: "Robert Knight" <robertknight@gmail.com>
To: zsh-users@sunsite.dk
Subject: Re: idea for new feature (was: Re: sticky-note and zle bindings)
Date: Sat, 7 Jun 2008 05:39:40 +0100	[thread overview]
Message-ID: <13ed09c00806062139g6e0e81eaxb350eaca45698a94@mail.gmail.com> (raw)
In-Reply-To: <20080128163340.GA18831@spiegl.de>

Hi folks,

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

(1)  The terminal emulator creates a unique alphanumeric ID string for each
new session and passes it to the shell as an environment variable
$SHELL_SESSION_ID.
When the shell is killed via a SIGHUP it saves that state and the
associated session ID.
When restoring that session, the terminal emulator starts a new
instance of the shell as
usual, with the previously used $SHELL_SESSION_ID value.  The shell
looks for state saved
under that name and restores the previous state.  If no state is saved
against the id then
the shell can assume that it is a new session.  The ID would be
alphanumeric, with no fixed
length or format.  I would probably use Qt's UUID generator to come up
with something suitable
but users might choose human-readable names if they wanted to do their
own session management.

(2)  The terminal emulator specifies a file for the shell to save its
state information
to.  If the file is empty or does not exist then the shell assumes
this is a new session.  Otherwise it restores the contents of the
file.  The save/restore handling then works as in (1).

I favour the first option because the shell can pick a suitable place
to store its
state information which is in the same location/format as the rest of
its data.  Unlike a filename, an ID also works over remote
connections.

Policies over exactly what gets saved and restored and how long that
information should be kept for would be left up to the shell to begin
with.
I can make suggestions about what would be most useful however,
roughly in priority order.
The real gist is to minimize the time spent doing repetetive setup
routines to prepare for
working on various tasks.

- Environment variables (probably not the complete environment but
rather a delta between
the environment inherited by the shell when it started and the
environment in the shell when
it was closed)
- Prompt
- Aliases
- Functions

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.

Regards,
Robert.

2008/1/28 Andy Spiegl <zsh.Andy@spiegl.de>:
> On 2008-01-26, 15:31, Bart Schaefer wrote:
>> } Restoring the programs that ran is a very interesting idea. I like it :)
>>
>> Not "the programs that ran".  The programs that *were running*; that is,
>> something the shell had to SIGHUP when it exited.  I'd be very leery of
>> automatically restarting anything other than the foreground job, though,
>> and maybe not even that if it was a pipeline.
>
> I really like the idea of restoring the program that was running
> before the "crash", but I'd suggest not to reexecute it (which may
> have fatal side effects) but just putting it on the command line.
> The user can then decide whether to press enter or not.
>
> Chau,
>  Andy.
>
> --
>  Once you've seen one shopping center you've seen a mall.
>


  reply	other threads:[~2008-06-10  3:51 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-24 18:17 Robert Knight
2008-01-24 20:09 ` Richard Hartmann
2008-01-24 20:54   ` Richard Hartmann
2008-01-24 21:54     ` Robert Knight
2008-01-24 23:22       ` Richard Hartmann
     [not found]         ` <13ed09c00801241857n2b1613f0m2d74fd12a90135cc@mail.gmail.com>
2008-01-25  9:32           ` Richard Hartmann
2008-01-25 17:57             ` Bart Schaefer
2008-01-25 18:18               ` Robert Knight
2008-01-26  2:12                 ` Bart Schaefer
2008-01-26 15:41                   ` Richard Hartmann
2008-01-26 23:31                     ` Bart Schaefer
2008-01-28 16:33                       ` Andy Spiegl
2008-06-07  4:39                         ` Robert Knight [this message]
2008-06-10  4:13                           ` Benjamin R. Haskell
2008-06-11  0:02                             ` Richard Hartmann
2008-06-11  0:26                               ` Benjamin R. Haskell
2008-06-11  1:17                                 ` Richard Hartmann
2008-06-11  4:48                                   ` [ZSH] " Benjamin R. Haskell
2008-06-11  4:43                                 ` Bart Schaefer
2008-06-11  4:51                                   ` Benjamin R. Haskell
2008-06-11 11:47                                 ` Angel Olivera
2008-06-10 23:57                           ` Richard Hartmann
2008-06-20 12:06                           ` Richard Hartmann
2008-06-27 16:25                             ` Richard Hartmann
2008-01-26 15:19               ` Richard Hartmann
2008-01-26 15:26                 ` Clint Adams
2008-01-26 15:42                   ` Richard Hartmann
2008-01-26 15:43                   ` Richard Hartmann
2008-01-27 16:28                     ` OT: env vars passed by ssh [was Re: idea for new feature (was: Re: sticky-note and zle bindings)] Clint Adams
2008-01-26 13:38           ` Fwd: idea for new feature (was: Re: sticky-note and zle bindings) Richard Hartmann
2008-01-25  5:58 ` Bart Schaefer
2008-01-25  9:49   ` Richard Hartmann
2008-01-25 20:10     ` Bastian, Waldo
2008-01-26 15:29       ` Richard Hartmann
  -- strict thread matches above, loose matches on Subject: below --
2008-01-04 10:59 Fw: Zsh - push current command on history without executing it Peter Stephenson
2008-01-04 11:04 ` Mikael Magnusson
2008-01-04 11:24   ` Casper Gripenberg
2008-01-09 18:58     ` zzapper
2008-01-13  8:00       ` Bart Schaefer
2008-01-16 13:10         ` sticky-note and zle bindings Andy Spiegl
2008-01-16 15:59           ` Bart Schaefer
2008-01-16 17:12             ` idea for new feature (was: Re: sticky-note and zle bindings) Andy Spiegl
2008-01-17  3:11               ` Bart Schaefer
2008-01-17 17:26                 ` Andy Spiegl
2008-01-18  2:12                   ` Christopher Lord
2008-01-18  9:19                   ` Bart Schaefer
2008-01-19 22:24                     ` Andy Spiegl
2008-01-20  0:01                       ` Bart Schaefer
2008-01-20  4:36                         ` Matt Wozniski
2008-01-20  9:09                           ` Bart Schaefer
2008-01-18 21:21                 ` Richard Hartmann
2008-01-19 21:46                   ` Andy Spiegl
2008-01-19 23:05                     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13ed09c00806062139g6e0e81eaxb350eaca45698a94@mail.gmail.com \
    --to=robertknight@gmail.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).