Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: prompt and ssh
- X-seq: zsh-users 14153
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: prompt and ssh
- Date: Thu, 21 May 2009 09:41:03 +0200
- In-reply-to: <20090519200217.35368.qmail@xxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <e7db6e960905190954j7be72739p6b521bca8e90fe7f@xxxxxxxxxxxxxx> <20090519200217.35368.qmail@xxxxxxxxxxx>
On 2009-05-20 08:02:16 +1200, Atom Smasher wrote:
> On Tue, 19 May 2009, ugaciaka wrote:
>
>> I would like to change the type of zsh prompt the remote client (ssh):
>> if I connected remotely show differently prompt...
>>
>> What kind of condition if I can put on PS1?
> ==============
>
> you can test for SSH_CONNECTION, SSH_CLIENT, or SSH_TTY on the far side.
> i would recommend SSH_CONNECTION.
But this will not work well if you use "screen". For instance:
1. Connect to host remote_host by ssh.
2. Start a screen session. SSH_CONNECTION is inherited and the prompt
will say that you are connected by ssh (this is what you want).
3. Later, log on the machine directly (without ssh) and recall the
screen session. SSH_CONNECTION is still set (as the environment
doesn't change in the recalled shell) and the prompt will still
say that you are connected by ssh, while you are not.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author