- jeromel's home page
- Posts
- 2020
- 2019
- 2018
- 2017
- 2016
- 2015
- December (1)
- November (1)
- October (2)
- September (1)
- July (2)
- June (1)
- March (3)
- February (1)
- January (1)
- 2014
- 2013
- 2012
- 2011
- 2010
- December (2)
- November (1)
- October (4)
- August (3)
- July (3)
- June (2)
- May (1)
- April (4)
- March (1)
- February (1)
- January (2)
- 2009
- December (3)
- October (1)
- September (1)
- July (1)
- June (1)
- April (1)
- March (4)
- February (6)
- January (1)
- 2008
- My blog
- Post new blog entry
- All blogs
How to change Xterm titles
Updated on Tue, 2009-02-17 13:28 by testadmin. Originally created by jeromel on 2009-02-17 12:59.
I should know this by heart but ...
Window and icon titles may be changed in a running xterm by using XTerm escape sequences. The following sequences are useful in this respect:
ESC]0;<b>string</b>BEL
-- Set icon name and window title to stringESC]1;<b>string</b>BEL
-- Set icon name to stringESC]2;<b>string</b>BEL
-- Set window title to string
where ESC
is the escape character (\033), and BEL
is the bell character (\007).
echo -n "\033]0;${USER}@${HOST}\007"
should produce a title like username@hostname
, assuming the shell variables $USER
and $HOST
are set correctly. The required options for echo
may vary by shell (see examples below).
The following short script should help setting the title to an arbitrary value:
#!/bin/csh if ( "$1" != "") then /bin/echo "Setting title to [$1]" /bin/echo -ne "\033]0;"$1"\007" /bin/echo -ne "\033]1;"$1"\007" endif
»
- jeromel's blog
- Login or register to post comments