From a8970c4b276ff5281c91795d0141fadb2e8e1461 Mon Sep 17 00:00:00 2001 From: Matheus Date: Wed, 22 May 2024 14:08:13 -0300 Subject: [PATCH] tty: fix ECHOCTL --- kernel-src/io/tty.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel-src/io/tty.c b/kernel-src/io/tty.c index 1dfbe537..0b31556d 100644 --- a/kernel-src/io/tty.c +++ b/kernel-src/io/tty.c @@ -52,6 +52,15 @@ void tty_process(tty_t *tty, char c) { // TODO VSTART VSTOP + char echoc = (tty->termios.c_lflag & ECHO) ? c : '\0'; + + // echo control characters + if ((tty->termios.c_lflag & ECHOCTL) && (tty->termios.c_lflag & ECHO) && c < 32 && c != '\n' && c != '\r' && c != '\b' && c != '\t' && c != '\e') { + char tmp[2] = {'^', c + 0x40}; + tty->writetodevice(tty->deviceinternal, tmp, 2); + echoc = false; + } + if (tty->termios.c_lflag & ISIG) { int signal = -1; if (tty->termios.c_cc[VINTR] == c) @@ -71,15 +80,6 @@ void tty_process(tty_t *tty, char c) { } } - char echoc = (tty->termios.c_lflag & ECHO) ? c : '\0'; - - // echo control characters - if ((tty->termios.c_lflag & ECHOCTL) && c < 32 && c != '\n' && c != '\r' && c != '\b' && c != '\t' && c != '\e') { - char tmp[2] = {'^', c + 0x40}; - tty->writetodevice(tty->deviceinternal, tmp, 2); - echoc = false; - } - if (tty->termios.c_lflag & ICANON) { bool flush = false; if (c == tty->termios.c_cc[VERASE]) {