From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17623 invoked by alias); 18 Nov 2012 23:11:20 -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: 17414 Received: (qmail 15026 invoked from network); 18 Nov 2012 23:11:17 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.eastlink.ca designates 24.224.136.10 as permitted sender) X-Authority-Analysis: v=2.0 cv=TNAd0CZa c=1 sm=1 a=bWgGDZnfoeonEsxmbE2SBg==:17 a=-1ZKr4ocusoA:10 a=ZZQV8jkXHa0A:10 a=8nJEP1OIZ-IA:10 a=_lcLBkvvF3UA:10 a=q2GGsy2AAAAA:8 a=4KP8dvOIj0akjg2UhqQA:9 a=wPNLvfGTeEIA:10 a=I6wTmPyJxzYA:10 a=bWgGDZnfoeonEsxmbE2SBg==:117 Message-id: <50A96B10.6060208@eastlink.ca> Date: Sun, 18 Nov 2012 15:11:12 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: sharing environment between terminals. References: <50A82E58.4020104@eastlink.ca> <121118103514.ZM2913@torch.brasslantern.com> <20121118193340.2879a349@pws-pc.ntlworld.com> In-reply-to: <20121118193340.2879a349@pws-pc.ntlworld.com> Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit On 18/11/12 11:33 AM, Peter Stephenson wrote: > On Sun, 18 Nov 2012 10:35:14 -0800 > Bart Schaefer wrote: >> On Nov 17, 4:39pm, Ray Andrews wrote: >> } >> } Is there a way to instantly share environment variables between running >> } terminals? >> >> Generally speaking, no. The environment of each process is private to >> that process, allocated by the operating system at the time the process >> is forked. >> >> If desperate enough, you could set up something using the zsh/tcp module >> to have your shells cooperatively swap new environment strings around. >> One shell (or an external daeamon of some kind -- condsider the model >> used by ssh-agent) would have to control the "master" environment, and >> hand out changes to the other shells on request. The other shells would >> check at opportune times (during precmd for example) whether changes are >> available, and apply them. > It might be easier to intercept typeset etc. and turn them into shell > functions that save the environment. You'd probably need to do some > fairly nifty history-style timestamping to ensure you didn't simply > reimport the entire environment each time, however --- particularly to > ensure you got the latest results over all shells. > > Hmm, I wonder if doing something clever examining the actual saved > history (with INC_APPEND_HISTORY set) would help? > Peter, For now, I'm not going to get out of my depth with things. My nastly little hack does what I need it to do, so I'm going to rest with that for now unless there is a 'lite' fix that I can understand.