Comment 31 for bug 96676

On Tue, 14 Aug 2007, Izzy wrote:

> I just found out that the problem does *NOT* appear with konsole.

That's not unexpected, given the history of the feature.

I implemented the original flavor in (xterm of course)
  Patch #94 - 1999/3/27 - XFree86 3.9Pf
and made the change which seems to be the root of this discussion in
  Patch #167 - 2002/8/24 - XFree86 4.2.0
and documented/extended the permutations in
  Patch #216 - 2006/8/3
  Patch #223 - 2006/11/30

iirc, konsole is using the original flavor, while as noted, gnome-terminal
attempts to use the terminfo entry but reportedly is not associating
things in the same way that I setup for xterm.

Aside from unintentionally changing the default for the behavior that
corresponds to the modifyCursorKeys resource as noted for #223, I don't
_recall_ having changed anything in the terminfo which would be
incompatible - for xterm itself. gnome-terminal, of course, is expected
to work either way since it reads the terminal description.

> Checking a bit deeper, it uses TERM=linux - setting TERM=xterm here
> breaks a few things again. The other way round (setting TERM=linux in a
> xterm session) is not helpful at all. Side-effect of TERM=linux is that
> you lose mouse support (at least as far as Midnight Commander is
> affected). So you have the choice of "mouse XOR keyboard working fine".

Midnight Commander is probably linked with s-lang, which only looks for
"xterm" in $TERM to decide if the terminal supports mouse. ncurses
looks at the kmous capability (which is more reliable).

btw - the extra key-bindings for alt/shift/control modifiers in the
terminfo descriptions are invisible to s-lang, since it has its own
terminfo reader... (not really noticeable for Midnight Commander if
you're using the learn-keys feature).

> @Thomas Dickey: If you could send me the affected termcap files (and say
> where they belong to), I would try to replace mine (after a backup). If
> that solves the issue, we at least know how to work around the bug until
> it's solved (which I guess will not happen that soon - to be honest, I
> would even be surprised if it was solved in Gutsy).

I'm puzzled by the original description, which states that infocmp is
showing \EO rather than \E[ for the control sequence initiator, but am
guessing that Ubuntu is still assigning "xterm" to the 5-year-old version
of xterm. (While xterm can be configured to match this, that was changed
for a good reason, and it would be nice if we didn't have to deal with
antique bugs).

The way to construct a _terminfo_ entry (I thought Ubuntu is a repackager
of Debian...), is to make a text file such as

xterm|customized entry,

and compile that with tic (noting that if you're not root, then it may
go to $HOME/.terminfo - a bad feature which was depcrecated long ago).

See also

Thomas E. Dickey