[Top][All Lists]

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

Re: Setting window title in ssh'ed host

From: Gokdeniz Karadag
Subject: Re: Setting window title in ssh'ed host
Date: Tue, 15 Jul 2008 22:59:26 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20080512 Thunderbird/ Mnenhy/

Christian Ebert demis ki::
* Gokdeniz Karadag on Saturday, July 12, 2008 at 03:10:00 +0300
Setting the following in all machines achieves what I want, it sets screen title to hostname,
PROMPT_COMMAND='echo -n -e "\033k${HOSTNAME}\033\\"'
but when I connect to the machine out of screen, It prints the hostname
literally, so the prompt becomes like "hostname address@hidden $ " , which is
ugly and redundant.

To ensure that only ssh sessions within a GNU screen get the "title setter
prompt command", environment variables are useful, I can use the TERM variable,
but in stable debian, the default TERM=screen breaks vim editor, it goes crazy
when you press home, or pageup buttons.  Using TERM=xterm fixes this, so I
cannot check for TERM being equal to "screen".

Does checking for $STY work for your purposes?

if [ -n "$STY" ]
   <screen specific stuff>



That works on the machine where screen is run, but my main use for screen is to connect to many machines using ssh.

An environment var. does not get passed to the target shell, if *both* SendEnv in the client and AcceptEnv in the server is configured.

When TERM is properly set to "screen", I can use it on the target server without extra configuration as I wrote in my answer to Trent Buck.

Thank you for the answer.

Gokdeniz Karadag

reply via email to

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