zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh workers <zsh-workers@zsh.org>
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	[thread overview]
Message-ID: <CAHYJk3ShNM8n_9JKK=pyoniYA5WmMY0+8=ZV9-kirsSAQuSE_w@mail.gmail.com> (raw)
In-Reply-To: <150712154233.ZM5772@torch.brasslantern.com>

On Mon, Jul 13, 2015 at 12:42 AM, Bart Schaefer
<schaefer@brasslantern.com> 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


  parent reply	other threads:[~2015-07-13 18:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-12 13:12 Zaxebo Yaxebo
2015-07-12 14:44 ` Christian Neukirchen
2015-07-12 22:42 ` Bart Schaefer
2015-07-13 15:17   ` ZyX
2015-07-13 16:59     ` Bart Schaefer
2015-07-13 18:04   ` Mikael Magnusson [this message]
2015-07-13 18:44     ` Bart Schaefer

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='CAHYJk3ShNM8n_9JKK=pyoniYA5WmMY0+8=ZV9-kirsSAQuSE_w@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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).