summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2024-08-17 08:13:09 +0200
committerMaxime Coste <mawww@kakoune.org>2024-08-19 08:11:27 +1000
commitf4d8a831ff84eaf9280bf000133c661d4359bfa3 (patch)
treece545a46c056c137c3c09a3d68d0edb70226dd64 /src
parent2c923ba8272d455acd279951fee84bc2f6029051 (diff)
Don't interpret the \n input byte as <ret>
We set both ICRNL and INLCR, so there is no translation of \r to \n and vice versa. This means that when the user presses the Enter key, we always receive \r. So a "\n" input byte can realistically only be sent by <c-j> (or perhaps <c-J>), so we can interpret it as that. This intentionally breaks users that rely on <c-j> doing the same thing as <ret> on terminals that fail to disambiguate those two (for example gnome-terminal). This seems unavoidable; better teach them to map <c-j> separately sooner rather than later.
Diffstat (limited to 'src')
-rw-r--r--src/terminal_ui.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/terminal_ui.cc b/src/terminal_ui.cc
index fb8f1018..e5d2b56c 100644
--- a/src/terminal_ui.cc
+++ b/src/terminal_ui.cc
@@ -703,7 +703,7 @@ Optional<Key> TerminalUI::get_next_key()
static constexpr auto control = [](char c) { return c & 037; };
auto convert = [this](Codepoint c) -> Codepoint {
- if (c == control('m') or c == control('j'))
+ if (c == control('m'))
return Key::Return;
if (c == control('i'))
return Key::Tab;