From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27839 invoked by alias); 26 Nov 2014 18:38:04 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19449 Received: (qmail 18085 invoked from network); 26 Nov 2014 18:37:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Yandex-Uniq: 862ee4f0-9108-4b11-b4c5-e15fdeb196f5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1417026424; bh=ExKX6de7cF4s/S9toVfrX+8GZyTaZgVi9X4OGnPQLiI=; h=User-Agent:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Content-Type:Subject:From:Date:To: Message-ID; b=uq2PI7tMsDi9dLR+cFEvb0Jv+iAkZj6puj0Nqm2K8kt4DsGmusdlpohf25oH6wDWs 8C3YsJFIemF7LvVRWIemrxpjalEIWFF2G4HIemjCQCAHDnVUek76SXZruu1K4BDMkV GFA63SGxkK7Km0msiRK+cVi3m3PTPldP/cjGuv/4= Authentication-Results: smtp3h.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: K-9 Mail for Android In-Reply-To: <54761157.8040406@eastlink.ca> References: <54752574.5090205@eastlink.ca> <141125203249.ZM18877@torch.brasslantern.com> <54756007.6060800@eastlink.ca> <54761157.8040406@eastlink.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: export From: =?UTF-8?B?0J/QsNCy0LvQvtCyINCd0LjQutC+0LvQsNC5?= =?UTF-8?B?INCQ0LvQtdC60YHQsNC90LTRgNC+0LLQuNGH?= Date: Wed, 26 Nov 2014 21:26:50 +0300 To: Ray Andrews ,Zsh Users Message-ID: <4A84D87C-6A3B-4F07-90FC-A403CEFE943E@yandex.ru> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On November 26, 2014 8:43:51 PM EAT, Ray Andrews wrote: >All: > >> Each process gets a private copy of the environment provided by its >> parent. An xterm is just a process. In your example you have this >chain >> of processes (parent => child): >> >> xterm => zsh => zsh >> >> There is no way for an arbitrary zsh process to affect the >environment >> of an arbitrary xterm process. > >Yeah, I understand the 'inheritance'. I just thought that 'export' >might >somehow >be ramped up to overcome that. > >We certainly can do what I want, it's just a little bit of trouble: > > universal() { echo "$1" >>! /tmp/universal; . /tmp/universal } > >And in .zshrc: > > preexec () { [ -e /tmp/universal ] && . /tmp/universal } > >Now in xterm #6: > > pts/6 HP-y5--5-Debian1 root /aWorking/Zsh $ universal "trash=trash" > > pts/6 HP-y5--5-Debian1 root /aWorking/Zsh $ echo $trash > trash > >Now hop over to xterm #12: > > pts/12 HP-y5--5-Debian1 root /aWorking/Zsh $ echo $trash > trash > >... so we can universally export instantly. I normally have four >xterms >open at the same time, so being able to do that is very handy. > >The above is obviously rather crude, but it's simple and it works. And >you >can throw a command in there too. > >As Kurtis said, it might be dangerous, but I live on the edge ;-) > >----------------------- > >FYI, the "fish" shell does that. > > >set -U universal its value > > >and that $universal variable (here an array) becomes available > >in all the fish shells (interactive or not) by the same user on > >the machine (with all the security implications it entails). > >That's very cool, I think we should have it too. This feature is constantly getting me mad. I have set some variable for testing and some code exported it. Now all shells are in the same state, including the new ones. Super! I am getting mad even though I use fish *only* for testing. I do not think that this feature should be in a zsh core, especially given that it can easily be implemented as a plugin. -----BEGIN PGP SIGNATURE----- Version: APG v1.1.1 iQJNBAEBCgA3BQJUdhtpMBwfMDI7PjIgHTg6PjswOSAQOzU6QTA9NEA+MjhHIDxr cC1wYXZAeWFuZGV4LnJ1PgAKCRBu+P2/AXZZIpgrD/9pSppBKJ/HB8SacGstcHrv Y7YAXQ0ty9uQyitrMuQh+Ob56E8x8TpwSEzVSepIeP8GF/u1VKwkIZhRpUrpe+lh NXB8GevDXzn3kxqu4n3x1GVXnqQ/nBKRxD0owU18j1x4DidFhyA592Mu+SVZQeY+ KFs8gVIxzRMMdgOyJ4suyJMrx2S7JmyXsCkJuu2wKjhpODzXw7oUk95OEnLJnlbK Q0adJgWN1pR10hnEDJuHGJ/uz3+UTpjZK95r1xm5GmGjcpI80GjOs218oqJIADwJ Ht/LThPnzZT8KJxu/d2NQ8LWg2nAtEZTiU96vEWMCmZU8duqg/DVVvieETba7F57 SZyM7WkDEcwE+zn5x/5+2hiWtexW27d5/ohB+yOHIUpWHgUD6cDuJvNQug0dDePK i6wiJ34L7NkUDuopr6mtm2Y9uL0T6Lt+nuWPCrzqYst+cf3W2/PYIUXwibTyOA2G 031+pI+fjKxScyTLVgc3D48iKcjEykA4Yx10VxXIsqlQo2w0Pn9fI5jiWKCPDcWy XiQjsPdknqhUTQ5ZUGxAwSnkVBKqz5wktdmprof67SVctIQfSbvQmIi8QWFhlKmu eNIu4y3uSqAxy7nlVsBc214pJ7+TmEodTItPPirDhfR8me0CzDStXHFfJKO5jeq/ Qt5RgCGQl6Xf0dgw+B3uAA== =KLt8 -----END PGP SIGNATURE-----