Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #1208200
| From | Vincent Lefevre <vincent@vinc17.net> |
|---|---|
| Newsgroups | linux.debian.bugs.dist |
| Subject | Bug#708979: closed by Gioele Barabucci <gioele@svario.it> (Re: Bug#708979: bash (readline): Something is wrong with binding keys to functions) |
| Date | 2024-08-13 18:50 +0200 |
| Message-ID | <Jb2SB-4LH4-9@gated-at.bofh.it> (permalink) |
| References | (3 earlier) <J9VJv-45eJ-15@gated-at.bofh.it> <Jb0xr-4Kqv-1@gated-at.bofh.it> <Jb1MR-4L57-3@gated-at.bofh.it> <lbbQu-7GC-25@gated-at.bofh.it> <Jb1MR-4L57-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 2024-08-13 16:28:42 +0100, Reuben Thomas wrote:
> I'm not quite sure I understand you here: are you saying that it's
> documented somewhere that one should use the "\e" form?
I'm saying that since the documentation says that the Meta key
may generate an Escape character (which is actually the case in
general), you should use the \e form as a consequence.
I think that knowing how things work exactly is complex due to
the various variables. From the readline(3readline) man page,
in particular:
convert-meta (On)
If set to On, readline will convert characters with the eighth
bit set to an ASCII key sequence by stripping the eighth bit and
prefixing it with an escape character (in effect, using escape as
the meta prefix). The default is On, but readline will set it to
Off if the locale contains eight-bit characters. This variable
is dependent on the LC_CTYPE locale category, and may change if
the locale is changed.
enable-meta-key (On)
When set to On, readline will try to enable any meta modifier key
the terminal claims to support when it is called. On many termi‐
nals, the meta key is used to send eight-bit characters.
(Note: This is wrong, nowadays, the Meta key generates an Escape
character.)
input-meta (Off)
If set to On, readline will enable eight-bit input (that is, it
will not clear the eighth bit in the characters it reads), re‐
gardless of what the terminal claims it can support. The name
meta-flag is a synonym for this variable. The default is Off,
but readline will set it to On if the locale contains eight-bit
characters. This variable is dependent on the LC_CTYPE locale
category, and may change if the locale is changed.
> As I said in my original report, "\M-" worked fine in readline 5.0.
> So as far as I can tell, it's a regression.
Indeed, you said:
"With readline 5.0 they work fine, but with 5.1 they don't work."
In the CHANGES file:
------------------------------------------------------------------------
This document details the changes between this version, readline-5.1,
and the previous version, readline-5.0.
[...]
m. Fixed a bug that caused "\M-x" style key bindings to not obey the setting
of the `convert-meta' variable.
------------------------------------------------------------------------
So you can get the previous behavior about the .inputrc file with
set convert-meta On
but this means that non-ASCII characters (i.e. with the 8th bit set)
will be regarded as ASCII characters with the Meta key.
> In any case, I can't see any sense in requiring \e for some keys and
> not others.
I suppose that this was historical. IMHO, any behavior based on the
8th bit should be removed. Nowadays, the 8th bit should be used for
non-ASCII characters, not to provide meta key information. This
would mean that "\M-" in the .inputrc file should behave like "\e".
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Bug#708979: closed by Gioele Barabucci <gioele@svario.it> (Re: Bug#708979: bash (readline): Something is wrong with binding keys to functions) Reuben Thomas <rrt@sc3d.org> - 2024-08-10 17:00 +0200
Bug#708979: closed by Gioele Barabucci <gioele@svario.it> (Re: Bug#708979: bash (readline): Something is wrong with binding keys to functions) Vincent Lefevre <vincent@vinc17.net> - 2024-08-13 16:20 +0200
Bug#708979: closed by Gioele Barabucci <gioele@svario.it> (Re: Bug#708979: bash (readline): Something is wrong with binding keys to functions) Reuben Thomas <rrt@sc3d.org> - 2024-08-13 17:40 +0200
Bug#708979: closed by Gioele Barabucci <gioele@svario.it> (Re: Bug#708979: bash (readline): Something is wrong with binding keys to functions) Vincent Lefevre <vincent@vinc17.net> - 2024-08-13 18:50 +0200
Bug#708979: closed by Gioele Barabucci <gioele@svario.it> (Re: Bug#708979: bash (readline): Something is wrong with binding keys to functions) Vincent Lefevre <vincent@vinc17.net> - 2024-08-13 19:00 +0200
Bug#708979: closed by Gioele Barabucci <gioele@svario.it> (Re: Bug#708979: bash (readline): Something is wrong with binding keys to functions) Reuben Thomas <rrt@sc3d.org> - 2024-08-13 19:50 +0200
csiph-web