Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Detecting whether one is using SSH
- X-seq: zsh-users 14572
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Detecting whether one is using SSH
- Date: Mon, 16 Nov 2009 20:14:10 -0500 (EST)
- In-reply-to: <4B01F221.2040204@xxxxxxxxx>
- 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>
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
Best,
Ben
Messages sorted by:
Reverse Date,
Date,
Thread,
Author