Sometimes there're lots of different sessions opened in own terminal's tabs and it's rather desirable to have theirs initial titles (named by session name) locked since local title tweaks make those sessions indistinguishable. It's obvious that controlling all the bits and pieces of remote software running is too wide task to be accomplished in reality, so the most suitable way would be setting a knob prohibiting any further changes to a title. I doubt there's such a knob, but who knows?

  • Heh. Meanwhile I still don't know answer to this question I've found out that konsole has special handling of "remote" session, which it seems to track using keyword ssh, but not slogin which I get used to type. So, at least I have a purpose to change this habit. :) – poige Mar 30 '12 at 15:59

According to this list of terminal directives (for various terminals, including X terminal emulators), no terminal directive supplies this exact feature (a shame).

In the unlikely case you're using xterm, you can disable ‘title ops’ using the Xterm Control-right-button menu, and very likely also using a command line option and X11 resource.

There may be hacks/kludges to fix the issue at the far end, but there'd be quite a bid of ad-hockery involved, and there isn't one catch-all solution.

  • Thanks! Actually I'd prefer to have solution for konsole and roxterm (since konsole is the fastest among ones with tabs, and roxterm is quite bearable). :-) – poige Mar 30 '12 at 12:53
  • 1
    @poige: for instance, Gnome Terminal just has a setting that allows to control title, by appending the programmatically set title to the pre-set title, or ignoring these commands altogether. I suspect that both Konsole and Roxterm may have similar settings. – 9000 Mar 31 '12 at 4:38
  • Konsole lets you set the tab title in Settings→Configure current profile…→Tabs. You can set the local and remote tab titles separately. On my konsole at least, the active tab title is also the window title. You can stick printf-like format specifiers for various things. This is konsole 2.7.4, but I know it's had that feature for years. – Alexios Mar 31 '12 at 8:49

I'm afraid that the solutions are specific to each terminal xterm, gnome-terminal, etc

For Xterm: If you want to lock the window title for a specific xterm instance from the command line you could use:

xterm -xrm "xterm*allowTitleOps: false" -T "my title"

This is useful if the Xterm is started from a script, or if you want to override the defaults.

For gnome-terminal: In the case of gnome-terminal, you need to create a profile with the option "When termnial commands set their own title: Keep initial title" and then start gnome-terminal like so:

gnome --tab-with-profile=<name of your profile> -t "<your window title>"
  • The 'allowTitleOps' bit can also be placed in an X11 resource file (such as ~/.Xresources) as XTerm*vt100.allowTitleOps: false, so that it's enabled every time...no need for the command line option – villapx Apr 21 '17 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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