Why doesn't ~/inputrc work
Sat May 7 18:24:00 GMT 2011
On 28 April 2011 13:40, Eliot Moss wrote:
> I took a while to play around. One thing you may need to
> do is set the TERM environment variable to a proper, more
> capable, terminal (such as "cygwin").
> Beyond that, I found that I needed to:
> set convert-meta on
That's not a solution for everyone, because it makes it impossible to
enter characters beyond 7-bit ASCII. The setting means that input
bytes with the eighth bit set have that bit cleared and are prefixed
by an escape character instead.
> in my .inputrc and also to write the escape sequences as
> (for example):
> "\M-b": "echo meta b"
To make this work without enabling convert-meta, try using "\eb"
instead of "\M-B". Here's why: back in the olden days, character codes
were 7 bits wide, so there was one bit to spare in your usual 8-bit
byte, and the Meta modifier key could be used to set that. Then those
pesky foreign types came along and claimed the eigth bit for their
ümläüts and other funny characters, which obviously collided with the
Meta bit. Therefore, a different scheme became necessary to encode the
Alt (née Meta) modifier: instead of setting the eighth bit, most
terminal emulators these days send an escape character prefix.
Inevitably, there's confusion on whether "Meta" should only refer to
ye olde eighth-bit scheme, or to the escape prefix scheme too.
In bash/readline's .inputrc without convert-meta on, the "\M-" refers
to the eighth-bit scheme only, so an Alt+b keypress sending Escape
followed by 'b' doesn't match "\M-b". In fact, with Cygwin's default
UTF-8 locale, a byte representing 'b' with the eighth bit set (i.e.
0xE2) actually constitutes an incomplete character sequence, hence
readline simply ignores such a key binding.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin