Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: idea for new feature (was: Re: sticky-note and zle bindings)
- X-seq: zsh-users 12481
- From: "Robert Knight" <robertknight@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: idea for new feature (was: Re: sticky-note and zle bindings)
- Date: Fri, 25 Jan 2008 18:18:49 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=HabIo4UiLjm/eUAsK34nnxfyFL5UC9JO4/bFkv+1BcY=; b=WXq8Syifr/RfUzFE1uI2Chx4I9wLnFTrr+YCysub5MT597wWlz2mzielO1covLoQvMTXKSgHE1E9BNp0witV4WnB+p98YeOSCYTFkeypIXyWii1wNao91PVxDm5Oc9HPsis8E5Gnrl+kJcGhNnhsm1JWxHgwy26K84Ijs3rkMQc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=l3vBULEUPoezjFStbTdU7ONP06rRxjDdJte5GKh2Wk70NZDBw8XIq6r72zQZ5wt8XPA4bXruTzSWHF+xjJQVTrTJWfn+Vuj14rNmIH224Z6+op/WRPq5GE47tF+JpHSqYD2pfE4KkbwjEtXPi/1PShLAujXbNxcUnS904Qg6j9I=
- In-reply-to: <080125095733.ZM20873@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <13ed09c00801241017x1cd7c454lcbf9156b6bccd9bb@xxxxxxxxxxxxxx> <2d460de70801241209u63a33fe6ufb8f396bff440dc6@xxxxxxxxxxxxxx> <2d460de70801241254v52d8a9c4he75e450f2f2bd29e@xxxxxxxxxxxxxx> <13ed09c00801241354g306f5aaay4d9e6f22c1622ec7@xxxxxxxxxxxxxx> <2d460de70801241522y47611d27k2e60c132fea1f01d@xxxxxxxxxxxxxx> <13ed09c00801241857n2b1613f0m2d74fd12a90135cc@xxxxxxxxxxxxxx> <2d460de70801250132n1692f74cn78d3fdc40da88b9@xxxxxxxxxxxxxx> <080125095733.ZM20873@xxxxxxxxxxxxxxxxxxxxxx>
Hi,
> Is what you mean that the shell needs to find out when it can "garbage
> collect" whatever data it has stored for a session that's never going
> to be resumed?
Yes.
> Here's a slightly different suggestion: Instead of SHELL_SESSION_ID,
> how about SHELL_SESSION_FILE ? The terminal creates a file and puts
> the path to it in the environment.
That would work when the shell is running locally, but what if the
shell is running on another system which the user is accessing via
ssh? The terminal emulator doesn't have direct access to the remote
file system.
Since the shell is the program which is storing the data, I think it
makes sense for it to be responsible for deciding where to put it,
rather than the terminal.
> OTOH if my shell *windows* in a GUI environment are disconnected, or
> the shell is killed by HUP, I probably didn't intentionally exit and I'd
> like the state restored, to the extent possible, when the GUI resumes.
That is my thinking too.
Regards,
Robert.
On 25/01/2008, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> (I never saw the original message from Robert Knight and it's not in the
> list archives.)
>
> On Jan 25, 10:32am, Richard Hartmann wrote:
> } Subject: Re: idea for new feature (was: Re: sticky-note and zle bindings)
> }
> } On Jan 25, 2008 3:57 AM, Robert Knight <robertknight@xxxxxxxxx> wrote:
> }
> } > There is a misunderstanding. By "end the session", I meant ending a
> } > session and removing all data associated with it. An analogy would be
> } > the option not to save the tabs in a web browser when closing it.
> } > Saving the session state would be the default behavior which would
> } > occur when logging out of the X session or closing the shell by
> } > sending SIGHUP for example.
>
> Shells are slightly different beasts than other applications. If I
> explicitly exit from a shell, I'm done with whatever that shell was
> doing, and if I were to then start a new shell I wouldn't want it to
> return to the context of the the last shell I exited; the chances are
> very good that the new thing I'll be doing has nothing to do with
> the last thing.
>
> OTOH if my shell *windows* in a GUI environment are disconnected, or
> the shell is killed by HUP, I probably didn't intentionally exit and I'd
> like the state restored, to the extent possible, when the GUI resumes.
> That applies whether the GUI session is exited abnormally or when I
> choose "Log Out" from a menu.
>
> This implies that commands in the .zlogout or equivalent need to be
> able to determine what caused the shell to exit: builtin command,
> user-generated EOF (ctrl-D), real EOF on stdin, HUP signal, etc.
>
> It also implies that the shell needs a way to tell the GUI environment
> NOT to attempt, independently, to restore current directory, etc.
>
> } One thing that would need to be decided is which sessions to delete
> } first. Oldest overall, oldest upate, smallest footprint, largest
> } footprint all have their respective merrits. Probably another option
>
> Scriptable. Don't bother trying to define this in the shell itself.
>
> } Another thing to note is that some people would probably want to keep
> } the respective histories seperate, other would want to merge them on
> } session 'detach', still others would probably want to merge the
> } information on explicit session destruction.
> } Option one could be done by hand by the route of
> } .zsh_history.$SHELL_SESSION_COOKIE
> } the others would probably, again, need options.
>
> Again scriptable.
>
> See Util/reporter in the zsh source distribution for examples of how to
> dump out various shell state.
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author