Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell
- X-seq: zsh-workers 35787
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell
- Date: Mon, 13 Jul 2015 20:04:10 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=hHan3rnIVGhmznl5jVVK4u3hYWhNR24QgCSSfDibySQ=; b=tMIoub1xxHovvJoHEP9uXG/Qu2sKnWvvGfMbglgyh5cZq0xyM8+ykeTabJI9QnN/F5 20/Xj6ay1AFUAfzJ73j8PFYe+r7SsLHUjgC557poWYmSGo8Az5HRE91u4YjyyfIHK61s oB7pDE44Gmt7zgx0hNTelQULPxfmcyiaTW3InvGbEAfjyL+R9EbTz8O8ZmO4U7Qeqlri cQDPYyd1jj0Ta8jvqD+9K3c0TsL3h18o+YTW/nyyDIVkhFO20RTiresIKP+ThUqyeD1O R6jYWMvtYAa/uEMw/9/8Ikwf9JsKWVjUgm7nwZdiQ7JWXp5Ou1kncHfbF5es+jAsdp1s DoXg==
- In-reply-to: <150712154233.ZM5772@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CABq-E=P8cOK=QbHmGAkL+0XCj-6yg0E2svYZs1OB1v=zYUg0_A@mail.gmail.com> <150712154233.ZM5772@torch.brasslantern.com>
On Mon, Jul 13, 2015 at 12:42 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jul 12, 6:42pm, Zaxebo Yaxebo wrote:
> }
> } *"Fish Shell" has a feature known as universal variables, which allow a
> } user to permanently assign a value to a variable across all the running
> } fish shells of that user. The variable value is remembered across logouts
> } and reboots, and updates in value are immediately propagated to all running
> } shells.*
>
> This was previously discussed in the thread starting here:
>
> http://www.zsh.org/cgi-bin/mla/redirect?USERNUMBER=19431
>
> The thread branches a bit but nobody suggested anything better than this:
>
> http://unix.stackexchange.com/questions/137077/serialize-shell-variable-in-bash-or-zsh
>
> We're almost certainly not going to implement the fish model of having a
> background server process that all other shells can contact to receive
> environment variable updates.
One half of it is fairly easy, you can just install a zle -F handler
(possibly coupled with the zsh/socket module) that updates parameters
that another process sends it. The other half, hooking into an
assignment of an arbitrary parameter to send it out again, I can't
think of any way of doing. Maybe you could have a set of functions
that maintains an array of parameter names, and check in zle-line-init
or something if any of them changed. I don't think we would want to
add "parameter assignment hooks"? eg, analogous to typeset -T you
would do typeset -P myfunction someparameter, and then myfunction is
called with someparameter as an argument (and the new value? and you
could assign to someparameter inside that function without causing a
recursive thing maybe). Anyway, I don't think we want that ;).
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author