1827251 Members
2725 Online
109716 Solutions
New Discussion

xterm window label

 
SOLVED
Go to solution
Michael Bouwma_1
New Member

xterm window label

I know I have seen this somwhere in the past, How can I on the fly change the label on the xterm I am using?
8 REPLIES 8
John Bolene
Honored Contributor

Re: xterm window label

If it is hpterm and most X windows, on startup you can specify -title xxxxx.

Don't think there is a way to change it after the window is open, but I have been wrong before.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Marco Paganini
Respected Contributor
Solution

Re: xterm window label

Hello Michael,

This page contains exactly the information you need:

http://www.linuxdoc.org/HOWTO/mini/Xterm-Title-6.html

Regards,
Paga
Keeping alive, until I die.
Craig Rants
Honored Contributor

Re: xterm window label

This is where I learned it.

Pretty cool stuff.

http://swexpert.com/C2/SE.C2.MAY.99.pdf

Have fun,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Michael Bouwma_1
New Member

Re: xterm window label

Thanks Marco, thats the ticket. Wow even a perl script. take a look John this is really cool, and sometime afetr xmas I might be intereseted in checking out your rocket stuff!
drop me a line @ MBouwma@softhome.net
John Bolene
Honored Contributor

Re: xterm window label

I feel a bit undereducated now, but learned a few things and still can't get it to work.

Sigh
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Craig Rants
Honored Contributor

Re: xterm window label

John,
Here is my script

#!/bin/sh
/bin/echo '\033]2;'$*'\007\c'

Use the command line
scriptname.sh "Xterm Title"

This should work for you.

C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
John Bolene
Honored Contributor

Re: xterm window label

Ahh, the light of day has arrived.

That esc string only works for dtterm, not hpterm.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Bill Hassell
Honored Contributor

Re: xterm window label

hpterm is an emulator for HP smart terminals such as the 2392A and the 700/92...series. There is virtually nothing in common between hpterm and xterm or dtterm. xterm and dtterm emulate the dumb vt100/vt200 series of terminals from way-back in computer years.

Use this to change hpterm's title bar and icon:

TITLE="My Favorite Window Title"
echo "\033&f0k${#TITLE}D${TITLE}\c"

This is unique to hpterm so there is no terminfo entry. Because there are so MANY different and incompatible terminals, the concept of a TERM variable plus a library of capabilities was developed. By using this library rather than hardcoding special escape sequences, programs like vi will work just fine on xterm or hpterm or many other terminal types.

From a script, you have a lot of flexibility to perform terminal manipulation by using tput. tput accepts special codes (man terminfo) and returns back the terminal-specific string needed to perform the action. You can clear any terminal with either:

$ clear
$ tput clear

But you can also do lots of terminal manipulation where there are no predefined commands to do so:

export HB=$(/usr/bin/tput dim) # dim text
export HV=$(/usr/bin/tput smso) # 1/2 bright inverse
export IV=$(/usr/bin/tput bold) # inverse
export UL=$(/usr/bin/tput smul) # underline
export BL=$(/usr/bin/tput blink) # blink
export CL=$(/usr/bin/tput clear) # home, clear screen
export ED=$(/usr/bin/tput ed) # clear to end of screen
export EE=$(/usr/bin/tput sgr0) # end all enhancements

# test some selected features:

echo "Testing $IV bold $HB half-brite $HV half-inverse $UL underline $EE"

And you'll see it works on all emulators. Now some terminal emulators do not have certain capabilities so the tput result will be null, and can be verified with the untic command.


Bill Hassell, sysadmin