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 12452
- From: "Christopher Lord" <christopherlord@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: idea for new feature (was: Re: sticky-note and zle bindings)
- Date: Thu, 17 Jan 2008 21:12:47 -0500
- 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=Va0oNUJ4IArmH8lwhMVuhQ4ei+52lf1bvdSYCF00eFc=; b=bBv1RGyjofU4MDIBoYNxkU3uJPDVmmCNykQlBnLJKWhSuBdXiSau+WLxlsr6qBsAi8qdVyk/TFj6N1PEpaC4uHJBnmVx8JmG+Vw9iWppyuZyg9V35NVBq1Q9qxVx/rVTdvB1B7Rn/daNFhzbOpF/EpnK/rycxi5YJIs4rAvda6E=
- 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=v7eT8B22TNOhu6sBA250VWCyd4BF5JJQ7HAzPmXFbm63zq4Z9Xfn3WT20vGtChUiMl36JDLu8mUYK6vIbpqIhBKm+eShR+yQO6xccQ5x2f0eNT+s8FUsWLV/EnWeDIfDp8loAGhNrfZYxR7609oXVIA7eQxLl975A3x6XFRhitM=
- In-reply-to: <20080117172603.GA664@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20080104105900.37a87f7e@news01> <237967ef0801040304h494987bv939bf6ff9541123f@xxxxxxxxxxxxxx> <477E177A.3060303@xxxxxxxxxxxxx> <Xns9A20C0F173D23zzappergmailcom@xxxxxxxxxxxx> <080113000048.ZM15017@xxxxxxxxxxxxxxxxxxxxxx> <20080116131048.GC16058@xxxxxxxxx> <080116075915.ZM12209@xxxxxxxxxxxxxxxxxxxxxx> <20080116171253.GF16058@xxxxxxxxx> <080116191103.ZM12889@xxxxxxxxxxxxxxxxxxxxxx> <20080117172603.GA664@xxxxxxxxx>
I do something like this using gnu screen. I have 12 windows (one for
each F-key). Screen starts each shell with an environment variable
$WINDOW. It's just an integer representing each window. I have my
history set up to write to ~/.zshist/history.$WINDOW. Then each window
writes the history to it's own history file.
I currently don't persist the $PWD into a file, but I imagine it is
pretty trivial to accomplish — just write $PWD to a file
~/.zshist/curdir.$WINDOW on precmd.
On Jan 17, 2008 12:26 PM, Andy Spiegl <zsh.Andy@xxxxxxxxx> wrote:
> On 2008-01-16, 19:11, Bart Schaefer wrote:
> > Of course this is what share_history and inc_append_history are in
> > part intended to accomplish.
> Only for the command history, though.
> I was thinking about the directory stack.
>
> > 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?
> You're right - that's too complex and depends heavily on the user environment.
> But zsh could start the cooperation by providing the saved data and some kind
> of mechanism of reading it back in to restore the directory stack.
>
> Having that, it will be up to the users/terminal-guys/xserver-guys to use
> that data. When they know that zsh provides this they might be interested
> in using it.
>
> > 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.
> Right, so let's start. :-)
>
> > It's pretty simple to dump state somewhere from the precmd() function
> In a separate file for each zsh instance? Using the PID? Or a counter?
> Or maybe some unique identifier for each instance, say shell1, shell2, ...
> That way zsh could check at startup whether there is a state-file for
> its name and read it back in. The unique name should probably be in
> an environment variable. Hm, then in .xsession you would start several
> xterms with shells like that:
> ZSHNAME="shell-1" /usr/bin/xterm -geometry 90x45+89+212 -T "Shell-1"
> ZSHNAME="shell-2" /usr/bin/xterm -geometry 90x45+89+212 -T "Shell-2"
>
> How about that?
>
> Bye,
> Andy.
>
> --
> To err is human. To really screw it up takes a computer.
>
--
Christopher Lord
(w) www.clawbox.com
(e) christopherlord@xxxxxxxxx
(w) 1-905-413-3765
(m) 1-416-788-2564
Messages sorted by:
Reverse Date,
Date,
Thread,
Author