From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14782 invoked from network); 1 Apr 2001 04:43:05 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Apr 2001 04:43:05 -0000 Received: (qmail 16894 invoked by alias); 1 Apr 2001 04:42:53 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3786 Received: (qmail 16883 invoked from network); 1 Apr 2001 04:42:52 -0000 From: "Bart Schaefer" Message-Id: <1010401044150.ZM8759@candle.brasslantern.com> Date: Sun, 1 Apr 2001 04:41:50 +0000 In-Reply-To: <200104010353.f313rvu04868@soup.in.ql.org> Comments: In reply to "E. Jay Berkenbilt" "Re: Differrent prompt for remote machines" (Mar 31, 10:53pm) References: <1010331191449.ZM8000@candle.brasslantern.com> <200104010353.f313rvu04868@soup.in.ql.org> X-Mailer: Z-Mail (5.0.0 30July97) To: "E. Jay Berkenbilt" Subject: Re: Differrent prompt for remote machines Cc: zsh-users@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 31, 10:53pm, E. Jay Berkenbilt wrote: } } I determine whether I'm remote using this C program I wrote. I've } tested it only linux. It uses the fact that most well-behaved remote } login daemons make sure that your tty's utmp entry contains the host } from which you logged in if you are logged in remotely. This is essentially the same as [[ "${$(who am i)%%!*}" = $HOST ]]. It's a reasonable approach, but it doesn't work when `XTerm*UtmpInhibit: true', nor when e.g. `xon remotehost xterm' was used, nor when ssh is performing X11 port-forwarding. Unless I'm missing something? (Where "doesn't work" means that those three cases will report unknown, local, and local, respectively, I believe.) -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net