Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Differrent prompt for remote machines

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   

Messages sorted by: Reverse Date, Date, Thread, Author