From 8d1b00b851dad0205f00c73f9395dc2d920980db Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Wed, 21 Jun 2023 21:06:58 +0900 Subject: [PATCH] tty: respect OPOST being unset --- kernel/vfs/tty.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/vfs/tty.c b/kernel/vfs/tty.c index 4fc03572..362c7d28 100644 --- a/kernel/vfs/tty.c +++ b/kernel/vfs/tty.c @@ -64,6 +64,11 @@ static void clear_input_buffer(pty_t * pty) { #define input_process tty_input_process void tty_output_process_slave(pty_t * pty, uint8_t c) { + if (!(pty->tios.c_oflag & OPOST)) { + OUT(c); + return; + } + if (c == '\n' && (pty->tios.c_oflag & ONLCR)) { c = '\n'; OUT(c);