diff --git a/src/builtins/bind.rs b/src/builtins/bind.rs index 3ddb73b82..812526c01 100644 --- a/src/builtins/bind.rs +++ b/src/builtins/bind.rs @@ -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!( diff --git a/src/key.rs b/src/key.rs index 97bffbfab..36cd4de66 100644 --- a/src/key.rs +++ b/src/key.rs @@ -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') { diff --git a/tests/checks/bind.fish b/tests/checks/bind.fish index b71785620..f48a9e544 100644 --- a/tests/checks/bind.fish +++ b/tests/checks/bind.fish @@ -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