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

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


> It works with gnome-terminal, with konsole it doesn't.
> But konsole must have some kind of state management because
> my wife's KDE Desktop restores all shells including the PWD.

Konsole/KDE 3 reads the shell's current working directory from /proc
and saves that information.  When logging in again it opens each
window / tab with the same binary and with the working directory
recorded from /proc at shutdown.  This is a pretty poor solution since
information about the shell's variables (local and environment),
history, prompt etc. are not kept.

Please don't try to do window state setup from the shell.  There are a
number of reasons for this:

- gnome-terminal and Konsole both support tabs and a variety of other
window state features which cannot be controlled using escape codes
- KDE already has good built-in facilities for handling window state
between sessions, it can do a better job than zsh.  This includes
cases where windows are spread across multiple displays.
- Konsole supports additional properties for each terminal such as
color scheme, key binding, scrollback settings and font setup which
only it has access to.

In summary, the shell should remember information which it knows best
(prompt,variables,history etc.) and the terminal should keep the
information which it knows best.

I think the SHELL_SESSION_COOKIE suggestion (perhaps
SHELL_SESSION_ID?) would be best from my point of view as a Konsole
developer.  The value should be a unique ID of a known format so that
terminals don't end up generating pre-existing IDs by mistake.
The only problem with this approach is that there needs to be a way
for a particular session to be ended.  Some options:

* End a session when an explicit command is sent to it (eg. 'Ctrl+D' or 'exit')
* Don't end sessions.  Instead keep data around for the last X
sessions (where X might be 5,10 or 20).
* Define a new escape code to end a session.


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