From f62e2f972ba82df00856e7df6dfc846323d9a0cf Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Tue, 21 Jun 2022 19:19:05 +0200 Subject: [PATCH] Simplify stdin_configure() code --- src/tty.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tty.c b/src/tty.c index e24da9c..675c000 100644 --- a/src/tty.c +++ b/src/tty.c @@ -319,9 +319,7 @@ void stdin_configure(void) memcpy(&stdin_new, &stdin_old, sizeof(stdin_old)); /* Reconfigure stdin (RAW configuration) */ - stdin_new.c_iflag &= ~(ICRNL); // Do not translate CR -> NL on input - stdin_new.c_oflag &= ~(OPOST); - stdin_new.c_lflag &= ~(ECHO|ICANON|ISIG|ECHOE|ECHOK|ECHONL); + cfmakeraw(&stdin_new); /* Control characters */ stdin_new.c_cc[VTIME] = 0; /* Inter-character timer unused */