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 [EMAIL PROTECTED] $ " , 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>
fi

c

Hi,

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



_______________________________________________
screen-users mailing list
screen-users@gnu.org
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to