From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2194 invoked by alias); 18 Nov 2012 19:33:53 -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: 17412 Received: (qmail 20753 invoked from network); 18 Nov 2012 19:33: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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 209.85.215.171 is neither permitted nor denied by SPF record at ntlworld.com) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-proxyuser-ip:date:from:to:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=zZ2G3dKbun3Sbd3QUba98wJ6wZ+pfoh5iN+9A9Udxuo=; b=VskNgYBMsqm+NPe2+PIkCEWJBO/IGrsUyMTWTZryTxIX+UxP59jDqmd5ogARg5vOgF 3ACXfLRCg5R7G76+PeBgtqMq56KtHj9RJkSEpSs98+9hYFz8nfvCF2zvac4dOigbHTSi 0bwCxxwII7R0RQcJydT9+xxpaS4dOFfrmQ1wJMj/mjeoQe8MGpJGKpZwd6tttZgd75yL P3hqzzn7Wy9TUgrDz2u8kDuMBh0p6R2SzZJiOci3WA4Dr4AifClv+ar1PagBm8DLj47z a650SQYUyTRGX2yp0JtBAxLmLo3jgb8FvP//LtqgJZcvtv5UTxM2/QYi7hjqgJT3hg/U 7YEg== X-ProxyUser-IP: 82.8.55.192 Date: Sun, 18 Nov 2012 19:33:40 +0000 From: Peter Stephenson To: zsh-users@zsh.org Subject: Re: sharing environment between terminals. Message-ID: <20121118193340.2879a349@pws-pc.ntlworld.com> In-Reply-To: <121118103514.ZM2913@torch.brasslantern.com> References: <50A82E58.4020104@eastlink.ca> <121118103514.ZM2913@torch.brasslantern.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlMkahZGyzzKl7hhTpePhw1xhWkiIhwgYh5Q+cDKGH34UMkqfHbxwjZkWFHWKjAow3x5r6l 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 Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/