[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] _rl_untranslate_macro_value with meta control chars
From: |
G. Branden Robinson |
Subject: |
Re: [PATCH] _rl_untranslate_macro_value with meta control chars |
Date: |
Thu, 3 Aug 2023 09:03:08 -0500 |
Hi Grisha,
At 2023-08-03T06:24:25-0400, Grisha Levit wrote:
> When printing a macro, any character with the 8th bit set will be
> printed as `\M-' followed by the literal "unmetafied" character, even
> if the latter is a control character:
>
> $ bind '"_": "\201"'; bind -s | cat -v
> "_": "\M-^A"
>
> Or is a null byte:
>
> $ bind '"1PI": "π"'; bind -s
> "1PI": "\M-O\M-"
>
> $ bind '"2PI": "ππ"'; bind -s
> "2PI": "\M-O\M-"
I think the canonical way to represent a null byte (or, in this case, a
null bit septet within a byte) with this notation is ^@. And that is in
fact what I see.
$ bash --version | head -n 1
GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
$ bind '"1PI": "π"'; bind '"2PI": "ππ"'; bind '"_": "\201"'; \
> bind -s | cat -v
"1PI": "M-OM-^@"
"2PI": "M-OM-^@M-OM-^@"
"_": "M-^A"
Regards,
Branden
signature.asc
Description: PGP signature