From 7447c8faae1a4a1ecb1c452c376d4baac1ac4e59 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 20 Jun 2020 23:40:37 +0200 Subject: [PATCH] Also undo changes to ICRNL and INLCR These control the disambiguation between ctrl-j and ctrl-m. This can cause the enter key to send a ctrl-m, which programs might be unprepared for. (This is why you need to do `stty sane`) --- src/reader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/reader.cpp b/src/reader.cpp index 53b364def..cfd82fd7a 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -693,6 +693,8 @@ static void term_steal() { tty_modes_for_external_cmds.c_lflag |= ICANON; tty_modes_for_external_cmds.c_lflag |= IEXTEN; tty_modes_for_external_cmds.c_lflag |= ECHO; + tty_modes_for_external_cmds.c_iflag |= ICRNL; + tty_modes_for_external_cmds.c_iflag |= INLCR; while (true) {