screen-users
[Top][All Lists]
Advanced

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

Re: Dynamic Title


From: Asif Iqbal
Subject: Re: Dynamic Title
Date: Tue, 2 Jun 2009 16:54:57 -0400

On Tue, Jun 2, 2009 at 4:44 PM, Dan Mahoney, System Admin
<address@hidden> wrote:
> On Tue, 2 Jun 2009, Asif Iqbal wrote:
>
>> This is what I have done on the screen server to achieve dynamic title.
>>
>> in .bashrc :
>>
>> PROMPT_COMMAND='if [ $TERM = "screen" ]; then printf
>> "\033k${HOSTNAME%%.*}\033\\" ; fi'
>>
>> in .ssh/config :
>> # this won't work unless your screen server has openssh 5.1 or above
>> host *
>>  PermitLocalCommand   yes
>>  LocalCommand /path/to/screen_ssh.sh %n
>>
>>
>> in screen_ssh.sh :
>> # got the idea from http://www.tenshu.net/screen_ssh/
>
> Why would you tie this to your ssh command at all?
>
> I have a postcmd in my shell like this (this is tcsh):
>
> alias postcmd   'printf "\033%s%s %s %s\033\\" "k" "\!#:0" "\!#:$"
> "[$HOST]"'

You need to create that alias on every hosts. I have 300 of them.

>
> What this means is: give me the first and last bits of any command I type in
> my shelltitle (you'll find those are the important ones).
>
> which gives me:  ssh address@hidden [prime.gushi.org] when I ssh into
> systems that do NOT have a similar csh prompt.
>
> If I ssh into another system that has the same shell setup, I get:

I don't have to modify the shell and setup alias on all 300 hosts,
that I connect to, with this
ssh LocalCommand.

>
> usr/local/bin/irc irc.prison.net [oldprime.gushi.org] as my title
>
> This requires no special ssh privileges, works with ANY command, and works

it is your own .ssh/config file, so special priv needed

> even if you ssh from system a --> b --> c.
>
> -Dan
>
>
> --
>
> "What are you looking at?"
>
> "My brain!"
>
> -DM/SK, 2AM
>
>
> --------Dan Mahoney--------
> Techie,  Sysadmin,  WebGeek
> Gushi on efnet/undernet IRC
> ICQ: 13735144   AIM: LarpGM
> Site:  http://www.gushi.org
> ---------------------------
>
>



-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?




reply via email to

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