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

Re: Differrent prompt for remote machines



Dominik Vogt <d.vogt@xxxxxxxxxxx> writes:
>   I'm often logged in to different machines that all share the
>   same zsh configuration files (via ssh or telnet).  But I
>   frequently forget on which machine I am, mainly because either
>   I have the machine name in my promt for all machines or for no
>   machine at all.  What I'd like to have is this:
> 
>     For the machine at which I logged in:
> 
>       <username> ...
> 
>     and
> 
>       <username>@<machine> ...

I've got the following, which seems to catch that well in my setup, at
least.

if [[ $SSH_CLIENT = *.* || $REMOTEHOST = *.* ]] then
	PROMPT='<%m> %B%#%b '
else
   	PROMPT='%B%#%b '
fi

-matt

-- 
Matt Pharr    |    Exluna, Inc.    |    <URL:http://graphics.stanford.edu/~mmp>
===============================================================================
In a cruel and evil world, being cynical can allow you to get some
entertainment out of it. --Daniel Waters



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