screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting window title in ssh'ed host


From: Malte Skoruppa
Subject: Re: Setting window title in ssh'ed host
Date: Thu, 06 Nov 2008 11:25:00 +0100
User-agent: Thunderbird 2.0.0.16 (X11/20080923)

Hi,

I solved the problem in bash by editing my ~/.profile file:

ssh() {
args=$@
echo -ne "\033k${args##* }\033\\";
/usr/bin/ssh "$@";
}

It"s a rather simple script, whenever you call ssh, first this script is executed, which calls the real ssh in the end, with the same arguments. Before it does that, however, it sets the screen title to the last argument of the ssh command. Usually, this is the hostname, at least for the way I enter commands ;-)

Malte

Robin Lee Powell schrieb:
On Wed, Nov 05, 2008 at 10:50:31PM -0800, Micah Cowan wrote:
I don't really see how that does what the thread's talking about;
namely, set the window title to the hostname that's connected by
ssh.

You set your remote shell's PS1 to tell screen to set the title to
$(uname -n) or whatever.

As previously mentioned in these threads (IIRC?), the problem with
prompt hacks is you don't always have control over the prompts in
remote shells (and even when you do, it's a bit of a pain to set
up in every host you ever visit).

True enough.  The LocalCommand hack is kinda neat.

-Robin






reply via email to

[Prev in Thread] Current Thread [Next in Thread]