I don't have control over the shell prompt or preexec, and I want to keep the titles I assign to screens. Can I get screen to ignore title-escape-sequences?


1 Answer 1


If you have a terminal whose description "looks" like xterm, screen assumes it does everything like xterm. For whatever reason, it equates xterm-titles and xterm-mouse features:

  • in termcap.c, it checks if either the TERM environment variable contains the string "xterm" or "rxvt" — or it checks if there is a key definition for kM with the xterm-style \033[M string.
  • if that check fails, (follow the D_CXT symbol in ansi.c and display.c), screen suppresses the escape sequences for the mouse and for the title.

So you can do it, but probably not as you want: you could set TERM to vt100 (and screen wouldn't know about the mouse — or the title strings).

If you are really ambitious, you could modify screen, to make the two features separately configurable.

  • That sounds totally plausible, but I'm not seeing an actual answer? Is the implication that I lie about my terminal or maybe patch screen?
    – Raymond
    Jul 1, 2016 at 23:07
  • What about modifying screen's termcap? Is there a way to erase or override the specific capability or whatever the title function is called?
    – Raymond
    Jul 1, 2016 at 23:50
  • No - the title feature is not part of the termcap. (By the way, it's more likely than not actually terminfo underneath). Jul 1, 2016 at 23:55
  • I see. What about a widely-available terminal specification that isn't *xterm*|*rxvt*, but has color? I think I may just be asking too much. At this point I'm considering changing the remote COMMAND_PROMPT despite it coming from ephemeral VMs and needing to do it frequently and for shared accounts, or using the 'linux' TERM, or ... giving up, I guess.
    – Raymond
    Jul 2, 2016 at 1:05
  • The linux entry also defines the mouse-prefix, so that would cause screen to assume it supports title-strings. Jul 2, 2016 at 10:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .