Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If you start xterm from the command line giving it a title with the -T option

xterm -T "my window title" 

the window title is likely to be overwritten via escape sequences for the shell prompt, other programs' output, etc. Is there any way to prevent the initial title from being overridden?

share|improve this question

You can control whether xterm allows title changes with the Xresources option allowTitleOps described in man xterm. If you don't want to change the defaults for your user via the ~/.Xresources you can add Xresources options from the command line using the -xrm option:

 xterm -xrm "xterm*allowTitleOps: false" -T "my title"
share|improve this answer

Sometimes, it's desirable to keep the original title and allow the applications to add their own title.

That could be achieved with screen. If you add:

hardstatus string 'blah - [%h]'

to you ~/.screenrc, and start screen within that xterm, then the title will always contain blah, but the applications will be able to set the part inside [...] with the usual \e[2;...\a or \e[2;...\a escape sequences.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.