summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2015-09-16 15:31:51 +0200
committerLemonBoy <thatlemon@gmail.com>2015-09-19 12:22:58 +0200
commit061fb347502bd0b98f4587cfdce6612808d0c989 (patch)
treee707dce8b39dd3b411b5bb8a246ee5ff261e01fa /src
parent762c1d7f2c7478f1e98f847352e6cb3ca889c580 (diff)
downloadirssi-061fb347502bd0b98f4587cfdce6612808d0c989.zip
Modify the terminal initialization sequence
We disable the ICRNL flag to make Enter independent from ^J from the keybinding point of view since the former will now send ^M, leaving the user free to remap ^J without trapping itself into the irssi session because of a broken Enter key. Also disable the software flow control because we don't expect anyone to run irssi over a serial console; we gain some more freedom by having ^Q and ^S freely mappable by the user.
Diffstat (limited to 'src')
-rw-r--r--src/fe-text/terminfo-core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fe-text/terminfo-core.c b/src/fe-text/terminfo-core.c
index 6339e6f4..60927f1a 100644
--- a/src/fe-text/terminfo-core.c
+++ b/src/fe-text/terminfo-core.c
@@ -502,6 +502,9 @@ static void terminfo_input_init(TERM_REC *term)
memcpy(&term->tio, &term->old_tio, sizeof(term->tio));
term->tio.c_lflag &= ~(ICANON | ECHO); /* CBREAK, no ECHO */
+ /* Disable the ICRNL flag to disambiguate ^J and Enter, also disable the
+ * software flow control to leave ^Q and ^S ready to be bound */
+ term->tio.c_iflag &= ~(ICRNL | IXON | IXOFF);
term->tio.c_cc[VMIN] = 1; /* read() is satisfied after 1 char */
term->tio.c_cc[VTIME] = 0; /* No timer */