From 9c0680070d67d0cd8d365ac13d26e7a67a1b78c0 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 11 Dec 2022 18:20:24 +0100 Subject: [PATCH] Bind Shift+Return CSI u sequence to Return I often hit Shift-Return accidentally, which makes my terminal echo a weird escape sequence. Traditionally, terminals interpret Shift-Return as Return, so let's follow that behavior. Analoguous to commit 1dc526884 (Bind Shift+Space CSI u sequence to Space, 2022-04-24). --- share/functions/__fish_shared_key_bindings.fish | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/functions/__fish_shared_key_bindings.fish b/share/functions/__fish_shared_key_bindings.fish index 9233a9c8a..f5b5e6e50 100644 --- a/share/functions/__fish_shared_key_bindings.fish +++ b/share/functions/__fish_shared_key_bindings.fish @@ -192,9 +192,12 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod bind --preset $argv \n execute bind --preset $argv \r execute - # Control+Return behave like Return because it's easy to mistype after accepting an autosuggestion. + # Make Control+Return behave like Return because it's easy to mistype after accepting an autosuggestion. bind --preset $argv \e\[27\;5\;13~ execute # Sent with XTerm.vt100.formatOtherKeys: 0 bind --preset $argv \e\[13\;5u execute # CSI u sequence, sent with XTerm.vt100.formatOtherKeys: 1 + # Same for Shift+Return + bind --preset $argv \e\[27\;2\;13~ execute + bind --preset $argv \e\[13\;2u execute end end