Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Detecting whether one is using SSH
- X-seq: zsh-users 14575
- From: Renà 'Necoro' Neumann <lists@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Detecting whether one is using SSH
- Date: Tue, 17 Nov 2009 17:35:55 +0100
- In-reply-to: <alpine.LNX.2.01.0911162011500.24555@xxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <4B01F221.2040204@xxxxxxxxx> <alpine.LNX.2.01.0911162011500.24555@xxxxxxxxxxx>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Benjamin R. Haskell schrieb:
> On Tue, 17 Nov 2009, Renà 'Necoro' Neumann wrote:
>
>> Hi,
>>
>> I'm just wondering if it is possible to detect whether one is logged in
>> via SSH. I want to use it to switch to a different prompt color in that
>> case.
>
> Personally, I use the test: [ -n "$SSH_CLIENT" ]
>
> e.g.:
> [ -n "$SSH_CLIENT" ] && prompt_color=green || prompt_color=blue
Thanks. This works as expected :)
- - RenÃ
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAksC0OoACgkQ4UOg/zhYFuDM1QCghbebGjJAagGojg75qbJPI1GV
SR0An1zRTLKJhd62+EgsSB0jsvkESwHS
=LWLE
-----END PGP SIGNATURE-----
Messages sorted by:
Reverse Date,
Date,
Thread,
Author