Re: Alt key not recognized as Meta in xterm
Andy Koppe <andy.koppe <at> gmail.com>
2010-01-01 16:55:51 GMT
2009/12/30 Gary Carvell:
X issues including xterm ones should go to the cygwin-xfree list. I'm
sending this to both lists, but please respond on cygwin-xfree only.
> With the upgrade to Cygwin 1.7, I found that the Alt key is no longer
> recognized as a Meta key in xterm. This means the Alt based command
> line editing keys such as Alt-F/B for forward- and backward-word must
> be entered with the Esc key instead. I assume this is related to the
> internationalization changes in 1.7.
> I liked the old behavior better, but had some trouble changing it
> back. So here's my little hack for this in case anyone else finds it
> useful. In your home directory, create a file .Xdefaults containing
> this line:
> XTerm*vt100.metaSendsEscape: true
Actually that's not a hack, but the correct solution. I think this
needs to be part of the default config in /etc/X11/app-defaults/XTerm.
When that option is not enabled, 'meta' is sent by setting the highest
bit of the metafied character, e.g. 'f' (0x66) turns into 0xE6. That's
fine if you're using ASCII only, but obviously it'll conflict with any
character encodings beyond ASCII, e.g.in ISO-8859-1 and others, 0xE6
is æ (the ae ligature).
And in UTF-8, which of course is the Cygwin default now, a 0xE6 byte
would be an incomplete sequence. That's why xterm applies the meta bit
before doing the UTF-8 encoding, so Alt-f is sent as \xC3\xA6, which