aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/reader.cpp
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2015-11-30 15:44:51 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-12-08 21:01:31 -0800
commitd65c63322ef52443b372c3c49dbd3584596fed6b (patch)
treec3b6e2b32fbffb6521b7e68094b0918d05d8ea40 /src/reader.cpp
parent6943536ef30e9b6a84a162a2b1f065e0d5feff07 (diff)
allow \cJ (\n) to be bound separate from \cM (\r)
This makes it possible (on UNIX systems, don't know about MS Windows) to bind \cJ (\n) independently of \cM (\r, aka [enter]). Resolves #217
Diffstat (limited to 'src/reader.cpp')
-rw-r--r--src/reader.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/reader.cpp b/src/reader.cpp
index 63b70283..df196492 100644
--- a/src/reader.cpp
+++ b/src/reader.cpp
@@ -1028,6 +1028,8 @@ void reader_init()
/* Set the mode used for the terminal, initialized to the current mode */
memcpy(&shell_modes, &terminal_mode_on_startup, sizeof shell_modes);
+ shell_modes.c_iflag &= ~ICRNL; /* turn off mapping CR (\cM) to NL (\cJ) */
+ shell_modes.c_iflag &= ~INLCR; /* turn off mapping NL (\cJ) to CR (\cM) */
shell_modes.c_lflag &= ~ICANON; /* turn off canonical mode */
shell_modes.c_lflag &= ~ECHO; /* turn off echo mode */
shell_modes.c_iflag &= ~IXON; /* disable flow control */