Cannot bind "\M-o" to a new function when using UTF-8 locale

Bug #56734 reported by foolishchild
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
readline5 (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: libreadline5

Have put the following in .inputrc:
    "\M-o": "\C-p\C-a\M-f "
    "\M-s": menu-complete

Neither the M-o or M-s keys do anything. Standard things like M-. and M-f work fine. Other customisations like
    "\e[A": history-search-backward
in the same .inputrc work. So, some of my customisations in .inputrc work - but not all :(.

Revision history for this message
Micah Cowan (micahcowan) wrote :

Confirmed problem. Actually, I am also unable to bind even "\M-f" usefully (no matter what I put in my .inputrc, it still does forward-word).

However, if I set the locale (via LANG) to "C", then the binding works in console, rxvt and xterm; and gnome-terminal, *if* you also set Terminal -> Set Character Encoding to something like "Western (ISO-8859-1)" (might need to add it).

locale seems to be an issue for every terminal, so it's probably not a terminal issue... It also seems to affect more than just bash, so it's not a bash issue either. Looks like a bug in readline (as reported).

Also, the output of "bind -s" is strange in UTF-8 locales... it seems to output a single, high-order byte as the name of the bound "\M-o", which is obviously not a valid UTF-8 sequence.

I did my testing on Dapper Dan, with libreadline5-5.1-7build1

Changed in readline5:
status: Unconfirmed → Confirmed
Revision history for this message
foolishchild (j-clark) wrote : Re: [Bug 56734] Re: Cannot bind "\M-o" to a new function

Micah Cowan said the following on 17/08/06 20:19:
> Confirmed problem. Actually, I am also unable to bind even "\M-f"
> usefully (no matter what I put in my .inputrc, it still does forward-
> word).
>
Hi Micah,
Do you vet every bug report?
As you have so correctly indicated this is all because Iam trying to use
UTF8 in terminals. I thought it was supposed to be reliable now. Clearly
not.

Both these bugs I've reported, I searched for in the database first. Any
hints as to how to search?

Thanks for your time.

--
Regards,

Jonathan Clark

Revision history for this message
Micah Cowan (micahcowan) wrote : Re: [Bug 56734] Re: [Bug 56734] Re: Cannot bind "\M-o" to a new function

On Fri, Aug 18, 2006 at 06:00:59AM -0000, foolishchild wrote:
> Micah Cowan said the following on 17/08/06 20:19:
> > Confirmed problem. Actually, I am also unable to bind even "\M-f"
> > usefully (no matter what I put in my .inputrc, it still does forward-
> > word).
> >
> Hi Micah,
> Do you vet every bug report?

Heh, no. This one just happened to catch my eye.

The other one was a problem I also noticed, and bothered me a bit. I was
going to file a bug report, but did the search first and came across
yours.

> As you have so correctly indicated this is all because Iam trying to use
> UTF8 in terminals. I thought it was supposed to be reliable now. Clearly
> not.

Yeah, I'm surprised myself at how unstable this is. Though, I've never
been terribly impressed with the readline code, on the odd occaision
that I've looked at it.

> Both these bugs I've reported, I searched for in the database first. Any
> hints as to how to search?

I dunno: I mostly just scan through what's open (and sometimes, what's
not) to see if anything sounds like it could be it. It doesn't like
there were preexisting bugs for either of these, so seems like your
searching should be alright. :-)

...I'm actually very new to Ubuntu myself. Only started using it around
April. Just felt like I should learn as much as I can about it, and try
to do my part to make it a better Operating System. I've been filing
bugs more than trying to solve old ones; but the ones I filed (or
discover when I'm about to file, like yours), I try to do as much
research on as possible, in order to make the developers' jobs easier.
:-)

--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/

Micah Cowan (micahcowan)
Changed in readline5:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers