zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: idea for new feature (was: Re: sticky-note and zle bindings)
Date: Wed, 16 Jan 2008 19:11:03 -0800	[thread overview]
Message-ID: <080116191103.ZM12889@torch.brasslantern.com> (raw)
In-Reply-To: <20080116171253.GF16058@spiegl.de>

On Jan 16,  6:12pm, Andy Spiegl wrote:
}
} How about saving the current directory (or even the whole directory
} stack) of every zsh-instance so that it's possible to restore the
} status of all shells after an (in)voluntary crash, like network splits
} or an X-server crash.

Of course this is what share_history and inc_append_history are in
part intended to accomplish.

The problem is that zsh can't do it by iself.  So, your X server has
crashed and 20 shell windows went kablooie.  Even if every zsh has
faithfully been recording its state somewhere, how does each new
xterm you launch on the retarted X desktop know which one of the 20
saved states it should restore?

This is actually made *worse* by the fact that many modern X desktops
have "session managers" that will remember the apps and placement of
your windows and re-launch them on restart, so you may have 20 new
xterms all examining the set of state files effectively at once.

Even supposing your session manager doesn't do this, and you have a
command to launch a new xterm for every state file and somehow pass it
(ZDOTDIR maybe?) the name of the file it should initialize, zsh can't
track window placements or much of anything else that would help you
to tell which window is which after they reappear.

The upshot is that this isn't a zsh feature -- it's a cooperative
feature that requires effort from both the shell and whatever other
user interface environment it's running inside.  It's pretty simple
to dump state somewhere from the precmd() function, if only you know
what to do with it later.

One of my sysadmins back in grad school had a collection of csh scripts
read from his .login to do something like this, 20 years ago.  I never
saw them in detail, but I got the impression that they were stashing
away data they'd extracted from the SunWindows environment on his old
Sun-1 desktop (before there was such a thing as a sparc chip or even
OpenWindows -- can you say "black-and-white bitmap"?).  And he didn't
even have such a thing as precmd -- he was relying on aliases for "cd"
and the like.


  reply	other threads:[~2008-01-17  3:11 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-09 19:15       ` Paul Lew
2008-01-13  8:00       ` Bart Schaefer
2008-01-15 22:57         ` sticky-notes script [was: Zsh - push current command on history without executing it] Jean-Rene David
2008-01-16  8:06           ` 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 [this message]
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
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
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: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-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

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=080116191103.ZM12889@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).