[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dynamic Title
From: |
Dan Mahoney, System Admin |
Subject: |
Re: Dynamic Title |
Date: |
Tue, 2 Jun 2009 16:44:10 -0400 (EDT) |
User-agent: |
Alpine 2.00 (BSF 1167 2008-08-23) |
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]"'
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:
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
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
---------------------------
- Re: Dynamic Title, Michael Grant, 2009/06/01
- Re: Dynamic Title, Asif Iqbal, 2009/06/02
- Re: Dynamic Title,
Dan Mahoney, System Admin <=
- Re: Dynamic Title, Asif Iqbal, 2009/06/02
- Re: Dynamic Title, Dan Mahoney, System Admin, 2009/06/02
- Re: Dynamic Title, Asif Iqbal, 2009/06/02
- Re: Dynamic Title, Dan Mahoney, System Admin, 2009/06/02
- Re: Dynamic Title, Asif Iqbal, 2009/06/02
- Re: Dynamic Title, Brian Kroth, 2009/06/03
- Re: Dynamic Title, Asif Iqbal, 2009/06/03
- Re: Dynamic Title, Leen Smit, 2009/06/09
- Re: Dynamic Title, Brian Kroth, 2009/06/17