X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_00,FH_DATE_PAST_20XX,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <3fcf00670912291605t21702c70s95471152221ec091@mail.gmail.com> References: <3fcf00670912291605t21702c70s95471152221ec091 AT mail DOT gmail DOT com> Date: Fri, 1 Jan 2010 16:55:51 +0000 Message-ID: <416096c61001010855v777fa848kaa4529d0c9c10402@mail.gmail.com> Subject: Re: Alt key not recognized as Meta in xterm From: Andy Koppe To: cygwin AT cygwin DOT com, cygwin-xfree AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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: > > =C2=A0 =C2=A0XTerm*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 =C3=A6 (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 is the UTF-8 encoding for U+00E6 (again: =C3=A6) . But bash doesn't recognise that as Alt-f. > I'd be glad to hear any background information on the key mapping > change, or better ways to restore the old behavior. If you don't need anything beyond ASCII, you could go back to a singlebyte charset, e.g. by setting 'LANG=3Den_US.ISO-8859-1'. Otherwise, the escape prefix is the way to go. Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple