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

Re: Detecting whether one is using SSH



-----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