Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Changing the title of an xterm, whilst it's running
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
tom
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jun 2002
Posts: 83
Location: Guildford, UK

PostPosted: Fri Dec 20, 2002 5:53 pm    Post subject: Changing the title of an xterm, whilst it's running Reply with quote

I'm trying to figure out how I can change the title of an existing xterm window.

I want to this because I often find I am working with at least half a dozen xterm windows in one session, all doing completely different things (ssh, ftp, emerge, man, etc.) However, it is easy to get in a mess when Alt-Tabbing between them, since the task switcher just lists their titles (which are normally the default "xterm"). This can make finding the right window again a slow and annoying process!

I usually use small shell scripts to start up things like ssh, so I was thinking if I knew how, I could simply add a line to change that xterm's title to reflect the fact that it's now running ssh. Hope that makes sense.

Anyway, this has been bugging me for AGES, so if someone could suggest something, it would be most appreciated!!

tom.
Back to top
View user's profile Send private message
while(1)
n00b
n00b


Joined: 14 Dec 2002
Posts: 3
Location: New York, NY

PostPosted: Fri Dec 20, 2002 8:27 pm    Post subject: Reply with quote

this works in bash and will set the xterm title bar to the current directory (\w option):

Code:

PS1="# \e]2;\w\a"


for more bash fun, check out http://www-106.ibm.com/developerworks/linux/library/l-tip-prompt/
_________________
OO
Back to top
View user's profile Send private message
cytrox
n00b
n00b


Joined: 21 Aug 2002
Posts: 13

PostPosted: Fri Dec 20, 2002 11:39 pm    Post subject: Reply with quote

And for changing the title statically, like your 'ssh' in the title, have a look here http://cns.georgetown.edu/~ric/howto/Xterm-Title/.
so

Code:
echo -n "\033]0;ssh\007"


would do the job.

(But probably you have to use 'echo -en' instead of 'echo -n' to make the terminal interpret the escape code)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum