From 3c46dc2c0c69476a625611a556e67ddb8439629c Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Thu, 21 Nov 2024 10:28:52 +0100 Subject: [PATCH] Set `Ctrl-J`/`\n` to `ReedlineCommand::Enter` (#855) 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) {