From f709610a54d27de9c9397a6acdeea275a977caea Mon Sep 17 00:00:00 2001 From: sholderbach Date: Wed, 20 Nov 2024 22:51:08 +0100 Subject: [PATCH] Set `Ctrl-J`/`\n` to `ReedlineCommand::Enter` Permits terminal automation sending a `\n` to behave the same as if a `\r` is sent which is the canonical Enter according to ANSI/crossterm --- src/edit_mode/keybindings.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/edit_mode/keybindings.rs b/src/edit_mode/keybindings.rs index 7822ce0f..ef4636c7 100644 --- a/src/edit_mode/keybindings.rs +++ b/src/edit_mode/keybindings.rs @@ -234,7 +234,7 @@ pub fn add_common_edit_bindings(kb: &mut Keybindings) { ); kb.add_binding(KM::ALT, KC::Enter, edit_bind(EC::InsertNewline)); kb.add_binding(KM::SHIFT, KC::Enter, edit_bind(EC::InsertNewline)); - kb.add_binding(KM::CONTROL, KC::Char('j'), edit_bind(EC::InsertNewline)); + kb.add_binding(KM::CONTROL, KC::Char('j'), ReedlineEvent::Enter); } pub fn add_common_selection_bindings(kb: &mut Keybindings) {