Zsh Mailing List Archive
Messages sorted by:
Re: prompt and ssh
- X-seq: zsh-users 14154
- From: Atom Smasher <atom@xxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: prompt and ssh
- Date: Thu, 21 May 2009 22:27:53 +1200 (NZST)
- In-reply-to: <20090521074103.GN27141@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Openpgp: id=0xB88D52E4D9F57808; algo=1 (RSA); size=4096; url=http://atom.smasher.org/pgp.txt
- References: <e7db6e960905190954j7be72739p6b521bca8e90fe7f@xxxxxxxxxxxxxx> <20090519200217.35368.qmail@xxxxxxxxxxx> <20090521074103.GN27141@xxxxxxxxxxxxxxxxxxx>
On Thu, 21 May 2009, Vincent Lefevre wrote:
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.
that's a limitation of screen. whatever environment is available when a
session starts will always be with that session.
you ~could~ manually un/set SSH_* and then re-source the zshrc...?
762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
"Since trade ignores national boundaries and the manufacturer
insists on having the world as a market, the flag of his
nation must follow him, and the doors of the nations which
are closed against him must be battered down. Concessions
obtained by financiers must be safeguarded by ministers of
state, even if the sovereignty of unwilling nations be
outraged in the process. Colonies must be obtained or
planted, in order that no useful corner of the world may be
overlooked or left unused."
-- Woodrow Wilson,
President of the United States, 1919
Messages sorted by: