On Mon, 5 May 2008, Sergey Vlasov wrote:

On Sun, 4 May 2008 18:06:00 -0400 (EDT) Thomas Dickey wrote:

There is a control sequence in xterm which can change this mode, but
I'd be surprised if mc is using it.

Recent libreadline (used by bash) sends this - you can observe it with
'strace -e write bash':

write(2, "\33[?1034h", 8)               = 8

I did recall that - hadn't related it to mc...

When xterm receives this sequence, it switches to "8-bit mode"
(*VT100.eightBitInput: true), where the Meta key sets the 0x80 bit of
input characters instead of adding the ESC prefix.  The "konsole"
terminal emulator from KDE just ignores this sequence and continues to
send the ESC prefix for Meta.

yes - konsole doesn't implement the meta feature with or without the control sequence.

Apparently this sequence comes from the 'smm' string in the terminfo
database, which was added somewhere between the 211 and 222 releases
of xterm (I do not see an explanation for this in xterm.log.html).

It's in #216, added for completeness (since I'd added the control sequence at that point). I recall some discussion regarding readline, which turns on the feature if it exists (and commented that readline should have made it optional).

There does not seem to be a way to disable this behavior through the
libreadline config file (~/.inputrc).

A possible workaround in ~/.Xresources:

*VT100.altIsNotMeta:            true
*VT100.altSendsEscape:          true
*VT100.metaSendsEscape:         true
*VT100.Translations:            #override \
        Meta<KeyPress>: insert-seven-bit()

Setting just metaSendsEscape: true is not enough in the common case
when Meta and Alt are the same key - apparently in this case xterm
treats this modifier key as Alt instead of Meta, even though the Meta
translations work for it; and the code in input.c:Input() does not
reset the "eightbit" flag in the alt_sends_esc case, like it does for
meta_sends_esc, therefore the translation override is needed to
prevent setting of the 0x80 bit in addition to the ESC prefix.


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

Reply via email to