Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

2 Answers 2

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

 
discard

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.