In GNU readline, How to change Alt key to Meta, instead of being ESC?What is bash's meta key?How to change...
Sums of binomial coefficients weighted by incomplete gamma
Unconventional examples of mathematical modelling
Help, I cannot decide when to start the story
How can I find an old paper when the usual methods fail?
The more + the + comparative degree
Why did IBM make the PC BIOS source code public?
Adding things to bunches of things vs multiplication
Why won't the Republicans use a superdelegate system like the DNC in their nomination process?
Why aren't rockets built with truss structures inside their fuel & oxidizer tanks to increase structural strength?
Why does Japan use the same type of AC power outlet as the US?
How to get locks that are keyed alike?
What evidence points to a long ō in the first syllable of nōscō's present-tense form?
Telephone number in spoken words
How to programatically get all linked items for a given Sitecore item?
Number in overlapping range
Is this bar slide trick shown on Cheers real or a visual effect?
What is axle tramp?
List, map function based on a condition
Suspension compromise for urban use
Would the USA be eligible to join the European Union?
How can I communicate my issues with a potential date's pushy behavior?
What is the hottest thing in the universe?
Output the list of musical notes
What would cause a nuclear power plant to break down after 2000 years, but not sooner?
In GNU readline, How to change Alt key to Meta, instead of being ESC?
What is bash's meta key?How to change readline's/bash's meta key?How can I change readline settings on keypress?readline: How do I change keymaps from `emacs` to `vi-command` with a binding?Shortcut for line continuation (escaped newline) actionHow to Set Readline key bindings in both vi-command and vi-insert modes
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
In GNU readline manual, it says the left Alt is usually Meta:
The Meta key is labeled ALT on many keyboards. On keyboards with two keys labeled ALT (usually to either side of the space bar), the ALT on the left side is generally set to work as a Meta key.
But by experiment, I think the left Alt is actually ESC, rather than Meta. That's because, given the following inputrc configuration:
"eB": vi-bWord
Pressing AltShiftb works as expected.
However if I change the key binding to the following:
"M-B": vi-bWord
Pressing AltShiftb does nothing.
I'm wondering why Alt is actually ESC instead of Meta? How to change Alt to act as Meta key?
readline
add a comment |
In GNU readline manual, it says the left Alt is usually Meta:
The Meta key is labeled ALT on many keyboards. On keyboards with two keys labeled ALT (usually to either side of the space bar), the ALT on the left side is generally set to work as a Meta key.
But by experiment, I think the left Alt is actually ESC, rather than Meta. That's because, given the following inputrc configuration:
"eB": vi-bWord
Pressing AltShiftb works as expected.
However if I change the key binding to the following:
"M-B": vi-bWord
Pressing AltShiftb does nothing.
I'm wondering why Alt is actually ESC instead of Meta? How to change Alt to act as Meta key?
readline
2
unix.stackexchange.com/a/266490/70524
– muru
yesterday
Try in a shell started asINPUTRC=/dev/null LC_CTYPE=C bash --norc
. I don't think thatM-
works with utf-8 locales (haven't tried too much either, though ;-)).
– mosvy
yesterday
basically, readline should recognize ESC as a synonym for the meta-prefix."eB"
and"M-B"
should be synonymous.
– mosvy
yesterday
@mosvy Just triedLC_CTYPE=C
trick. This is interesting -- in UTF-8 locales,bind -p
shows alle
ESC prefixed key bindings, while in C locale they are justM-
prefixed as advertised in the manual. Seems Meta has some other uses in non-C locales? Combining several clues presented to me, including the answer linked by @muru (which I do not understand 100%) and readline variables likeinput-meta
,output-meta
,convert-meta
, I vaguely think Meta is not normally used because somehowM-
prefixed keys conflict with multi-byte characters??
– Naitree
yesterday
You can ignore (for now) the high-bit/metaSendsEscape mess -- your terminal is clearly sending ESC when you press ALT (you can make that sure by runningcat
and pressing ALT-p: it should print^[p
). The problem is why"eB"
and"M-B"
are only considered synonymous in bindings whenLC_CTYPE
is C -- I haven't got an answer for that, yet.
– mosvy
yesterday
add a comment |
In GNU readline manual, it says the left Alt is usually Meta:
The Meta key is labeled ALT on many keyboards. On keyboards with two keys labeled ALT (usually to either side of the space bar), the ALT on the left side is generally set to work as a Meta key.
But by experiment, I think the left Alt is actually ESC, rather than Meta. That's because, given the following inputrc configuration:
"eB": vi-bWord
Pressing AltShiftb works as expected.
However if I change the key binding to the following:
"M-B": vi-bWord
Pressing AltShiftb does nothing.
I'm wondering why Alt is actually ESC instead of Meta? How to change Alt to act as Meta key?
readline
In GNU readline manual, it says the left Alt is usually Meta:
The Meta key is labeled ALT on many keyboards. On keyboards with two keys labeled ALT (usually to either side of the space bar), the ALT on the left side is generally set to work as a Meta key.
But by experiment, I think the left Alt is actually ESC, rather than Meta. That's because, given the following inputrc configuration:
"eB": vi-bWord
Pressing AltShiftb works as expected.
However if I change the key binding to the following:
"M-B": vi-bWord
Pressing AltShiftb does nothing.
I'm wondering why Alt is actually ESC instead of Meta? How to change Alt to act as Meta key?
readline
readline
asked yesterday
NaitreeNaitree
3321 gold badge2 silver badges12 bronze badges
3321 gold badge2 silver badges12 bronze badges
2
unix.stackexchange.com/a/266490/70524
– muru
yesterday
Try in a shell started asINPUTRC=/dev/null LC_CTYPE=C bash --norc
. I don't think thatM-
works with utf-8 locales (haven't tried too much either, though ;-)).
– mosvy
yesterday
basically, readline should recognize ESC as a synonym for the meta-prefix."eB"
and"M-B"
should be synonymous.
– mosvy
yesterday
@mosvy Just triedLC_CTYPE=C
trick. This is interesting -- in UTF-8 locales,bind -p
shows alle
ESC prefixed key bindings, while in C locale they are justM-
prefixed as advertised in the manual. Seems Meta has some other uses in non-C locales? Combining several clues presented to me, including the answer linked by @muru (which I do not understand 100%) and readline variables likeinput-meta
,output-meta
,convert-meta
, I vaguely think Meta is not normally used because somehowM-
prefixed keys conflict with multi-byte characters??
– Naitree
yesterday
You can ignore (for now) the high-bit/metaSendsEscape mess -- your terminal is clearly sending ESC when you press ALT (you can make that sure by runningcat
and pressing ALT-p: it should print^[p
). The problem is why"eB"
and"M-B"
are only considered synonymous in bindings whenLC_CTYPE
is C -- I haven't got an answer for that, yet.
– mosvy
yesterday
add a comment |
2
unix.stackexchange.com/a/266490/70524
– muru
yesterday
Try in a shell started asINPUTRC=/dev/null LC_CTYPE=C bash --norc
. I don't think thatM-
works with utf-8 locales (haven't tried too much either, though ;-)).
– mosvy
yesterday
basically, readline should recognize ESC as a synonym for the meta-prefix."eB"
and"M-B"
should be synonymous.
– mosvy
yesterday
@mosvy Just triedLC_CTYPE=C
trick. This is interesting -- in UTF-8 locales,bind -p
shows alle
ESC prefixed key bindings, while in C locale they are justM-
prefixed as advertised in the manual. Seems Meta has some other uses in non-C locales? Combining several clues presented to me, including the answer linked by @muru (which I do not understand 100%) and readline variables likeinput-meta
,output-meta
,convert-meta
, I vaguely think Meta is not normally used because somehowM-
prefixed keys conflict with multi-byte characters??
– Naitree
yesterday
You can ignore (for now) the high-bit/metaSendsEscape mess -- your terminal is clearly sending ESC when you press ALT (you can make that sure by runningcat
and pressing ALT-p: it should print^[p
). The problem is why"eB"
and"M-B"
are only considered synonymous in bindings whenLC_CTYPE
is C -- I haven't got an answer for that, yet.
– mosvy
yesterday
2
2
unix.stackexchange.com/a/266490/70524
– muru
yesterday
unix.stackexchange.com/a/266490/70524
– muru
yesterday
Try in a shell started as
INPUTRC=/dev/null LC_CTYPE=C bash --norc
. I don't think that M-
works with utf-8 locales (haven't tried too much either, though ;-)).– mosvy
yesterday
Try in a shell started as
INPUTRC=/dev/null LC_CTYPE=C bash --norc
. I don't think that M-
works with utf-8 locales (haven't tried too much either, though ;-)).– mosvy
yesterday
basically, readline should recognize ESC as a synonym for the meta-prefix.
"eB"
and "M-B"
should be synonymous.– mosvy
yesterday
basically, readline should recognize ESC as a synonym for the meta-prefix.
"eB"
and "M-B"
should be synonymous.– mosvy
yesterday
@mosvy Just tried
LC_CTYPE=C
trick. This is interesting -- in UTF-8 locales, bind -p
shows all e
ESC prefixed key bindings, while in C locale they are just M-
prefixed as advertised in the manual. Seems Meta has some other uses in non-C locales? Combining several clues presented to me, including the answer linked by @muru (which I do not understand 100%) and readline variables like input-meta
, output-meta
, convert-meta
, I vaguely think Meta is not normally used because somehow M-
prefixed keys conflict with multi-byte characters??– Naitree
yesterday
@mosvy Just tried
LC_CTYPE=C
trick. This is interesting -- in UTF-8 locales, bind -p
shows all e
ESC prefixed key bindings, while in C locale they are just M-
prefixed as advertised in the manual. Seems Meta has some other uses in non-C locales? Combining several clues presented to me, including the answer linked by @muru (which I do not understand 100%) and readline variables like input-meta
, output-meta
, convert-meta
, I vaguely think Meta is not normally used because somehow M-
prefixed keys conflict with multi-byte characters??– Naitree
yesterday
You can ignore (for now) the high-bit/metaSendsEscape mess -- your terminal is clearly sending ESC when you press ALT (you can make that sure by running
cat
and pressing ALT-p: it should print ^[p
). The problem is why "eB"
and "M-B"
are only considered synonymous in bindings when LC_CTYPE
is C -- I haven't got an answer for that, yet.– mosvy
yesterday
You can ignore (for now) the high-bit/metaSendsEscape mess -- your terminal is clearly sending ESC when you press ALT (you can make that sure by running
cat
and pressing ALT-p: it should print ^[p
). The problem is why "eB"
and "M-B"
are only considered synonymous in bindings when LC_CTYPE
is C -- I haven't got an answer for that, yet.– mosvy
yesterday
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535538%2fin-gnu-readline-how-to-change-alt-key-to-meta-instead-of-being-esc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535538%2fin-gnu-readline-how-to-change-alt-key-to-meta-instead-of-being-esc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
unix.stackexchange.com/a/266490/70524
– muru
yesterday
Try in a shell started as
INPUTRC=/dev/null LC_CTYPE=C bash --norc
. I don't think thatM-
works with utf-8 locales (haven't tried too much either, though ;-)).– mosvy
yesterday
basically, readline should recognize ESC as a synonym for the meta-prefix.
"eB"
and"M-B"
should be synonymous.– mosvy
yesterday
@mosvy Just tried
LC_CTYPE=C
trick. This is interesting -- in UTF-8 locales,bind -p
shows alle
ESC prefixed key bindings, while in C locale they are justM-
prefixed as advertised in the manual. Seems Meta has some other uses in non-C locales? Combining several clues presented to me, including the answer linked by @muru (which I do not understand 100%) and readline variables likeinput-meta
,output-meta
,convert-meta
, I vaguely think Meta is not normally used because somehowM-
prefixed keys conflict with multi-byte characters??– Naitree
yesterday
You can ignore (for now) the high-bit/metaSendsEscape mess -- your terminal is clearly sending ESC when you press ALT (you can make that sure by running
cat
and pressing ALT-p: it should print^[p
). The problem is why"eB"
and"M-B"
are only considered synonymous in bindings whenLC_CTYPE
is C -- I haven't got an answer for that, yet.– mosvy
yesterday