Don't translate \n to enter

Apparently it's never entere because we turn off ICRNL.

I'm not sure why it says "no binding found".
This commit is contained in:
Johannes Altmanninger 2024-04-02 17:47:56 +02:00
parent 53961c7759
commit b04dee358e
3 changed files with 9 additions and 2 deletions

View File

@ -376,7 +376,7 @@ impl BuiltinBind {
streams.err.append(wgettext_fmt!(
"%ls: No binding found for key '%ls'\n",
cmd,
eseq
seq[0]
));
} else {
streams.err.append(wgettext_fmt!(

View File

@ -148,7 +148,7 @@ fn ascii_control(c: char) -> char {
}
pub(crate) fn canonicalize_keyed_control_char(c: char) -> char {
if c == ascii_control('m') || c == ascii_control('j') {
if c == ascii_control('m') {
return Enter;
}
if c == ascii_control('i') {

View File

@ -113,4 +113,11 @@ bind tab
bind ctrl-\b
# CHECKERR: bind: Cannot add control modifier to control character 'ctrl-h'
# Either Return or ctrl-m.
bind \r
# CHECK: bind --preset enter execute
# Never Return, probably always ctrl-j.
bind \n 2>&1
# CHECK: bind: No binding found for key 'ctrl-j'
exit 0