* [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell
@ 2015-07-12 13:12 Zaxebo Yaxebo
2015-07-12 14:44 ` Christian Neukirchen
2015-07-12 22:42 ` Bart Schaefer
0 siblings, 2 replies; 7+ messages in thread
From: Zaxebo Yaxebo @ 2015-07-12 13:12 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 1046 bytes --]
https://en.wikipedia.org/wiki/Friendly_interactive_shell#Universal_variables
Universal variables
*"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 will make emacs the default text editor. The '-U' tells fish to
# make this a universal variable.
> set -U EDITOR emacs
# This command will make the current working directory part of the fish
# prompt turn blue on all running fish instances.
> set -U fish_color_cwd blue
=======================
I request that this feature may be implemented in zsh
If I have two different zsh shell instances running from same user login
and i give this following command in one zsh instance
export -U varname=varvalue
OR, exportglobal varname=varvalue
then i can access it in my another zsh instance running from the same
userlogin.
Zax
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell
2015-07-12 13:12 [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell Zaxebo Yaxebo
@ 2015-07-12 14:44 ` Christian Neukirchen
2015-07-12 22:42 ` Bart Schaefer
1 sibling, 0 replies; 7+ messages in thread
From: Christian Neukirchen @ 2015-07-12 14:44 UTC (permalink / raw)
To: zsh-workers
Zaxebo Yaxebo <zaxebo1@gmail.com> writes:
> *"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.*
Unix already has this feature built-in, it's called "files".
--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell
2015-07-12 13:12 [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell 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 18:04 ` Mikael Magnusson
1 sibling, 2 replies; 7+ messages in thread
From: Bart Schaefer @ 2015-07-12 22:42 UTC (permalink / raw)
To: zsh-workers
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell
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
1 sibling, 1 reply; 7+ messages in thread
From: ZyX @ 2015-07-13 15:17 UTC (permalink / raw)
To: Bart Schaefer, zsh-workers
13.07.2015, 01:43, "Bart Schaefer" <schaefer@brasslantern.com>:
> 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.
AFAIK there is no longer such a thing. I am not really following fish development, but recently I received github email with comment to one of my issues (https://github.com/fish-shell/fish-shell/issues/1257#issuecomment-120921485) and it contains, literally:
> @zanchey is this still slated for 3.0 or might we see 2.3, now that 2.2 is out and fishd is out of the picture (I'm not sure how the fishd.${HOST} file fits in now with fishd gone).
Highlight: “now with fishd gone”.
I failed to find GH issue that describes fishd death, but commit log shows that the death starts with https://github.com/fish-shell/fish-shell/commit/6a94b51cbadb8609580fac5c693c02ca4ab39734 (which is in 2.2 release).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell
2015-07-13 15:17 ` ZyX
@ 2015-07-13 16:59 ` Bart Schaefer
0 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2015-07-13 16:59 UTC (permalink / raw)
To: zsh-workers
On Jul 13, 6:17pm, ZyX wrote:
}
} Highlight: "now with fishd gone".
}
} I failed to find GH issue that describes fishd death, but commit log shows that the death starts with https://github.com/fish-shell/fish-shell/commit/6a94b51cbadb8609580fac5c693c02ca4ab39734 (which is in 2.2 release).
Ah, so they're switching from a daemon to a shared file, using the same
file that the daemon previously maintained for data persistence.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell
2015-07-12 22:42 ` Bart Schaefer
2015-07-13 15:17 ` ZyX
@ 2015-07-13 18:04 ` Mikael Magnusson
2015-07-13 18:44 ` Bart Schaefer
1 sibling, 1 reply; 7+ messages in thread
From: Mikael Magnusson @ 2015-07-13 18:04 UTC (permalink / raw)
To: zsh workers
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell
2015-07-13 18:04 ` Mikael Magnusson
@ 2015-07-13 18:44 ` Bart Schaefer
0 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2015-07-13 18:44 UTC (permalink / raw)
To: zsh workers
On Jul 13, 8:04pm, Mikael Magnusson wrote:
}
} > 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 example in the doc for "zle -F" provides a template for this, but I
think a file-based exchange would be preferable.
} 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.
There's no good way to make "export -U" work, but a module implemented
in the manner of zsh/db/gdbm could define the "exportglobal" command
to create specially-tied variables. Could even use a GDBM file as the
persistence mechanism, it'd be almost exactly the same as what db_gdbm.c
already does if you limit the universal globals to scalars (otherwise
you have to deal with serializing arrays/hashes).
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-07-13 18:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-12 13:12 [Feature Request]: Globally updated Variables for all zsh instances for same user - just like fish shell 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
2015-07-13 18:44 ` Bart Schaefer
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).