From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2410 invoked by alias); 13 Jul 2015 18:04:19 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35787 Received: (qmail 25500 invoked from network); 13 Jul 2015 18:04:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 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== MIME-Version: 1.0 X-Received: by 10.107.170.77 with SMTP id t74mr1134068ioe.107.1436810650077; Mon, 13 Jul 2015 11:04:10 -0700 (PDT) In-Reply-To: <150712154233.ZM5772@torch.brasslantern.com> References: <150712154233.ZM5772@torch.brasslantern.com> Date: Mon, 13 Jul 2015 20:04:10 +0200 Message-ID: Subject: Re: [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell From: Mikael Magnusson To: zsh workers Content-Type: text/plain; charset=UTF-8 On Mon, Jul 13, 2015 at 12:42 AM, Bart Schaefer 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