diff --git a/Kernel/TTY.cpp b/Kernel/TTY.cpp index fca09c7f009..1067f72f58f 100644 --- a/Kernel/TTY.cpp +++ b/Kernel/TTY.cpp @@ -4,6 +4,8 @@ #include #include +//#define TTY_DEBUG + void DoubleBuffer::flip() { ASSERT(m_read_buffer_index == m_read_buffer->size()); @@ -48,6 +50,9 @@ ssize_t TTY::read(byte* buffer, size_t size) ssize_t TTY::write(const byte* buffer, size_t size) { +#ifdef TTY_DEBUG + dbgprintf("TTY::write %b {%u}\n", buffer[0], size); +#endif onTTYWrite(buffer, size); return 0; } @@ -81,10 +86,12 @@ void TTY::interrupt() void TTY::set_termios(const Unix::termios& t) { m_termios = t; - dbgprintf("%s set_termios: IECHO? %u, ISIG? %u\n", + dbgprintf("%s set_termios: IECHO? %u, ISIG? %u, ICANON? %u\n", ttyName().characters(), should_echo_input(), - should_generate_signals()); + should_generate_signals(), + in_canonical_mode() + ); } int TTY::ioctl(Process& process, unsigned request, unsigned arg) diff --git a/Kernel/TTY.h b/Kernel/TTY.h index b1a45ab9a20..9c3dfa2c219 100644 --- a/Kernel/TTY.h +++ b/Kernel/TTY.h @@ -46,6 +46,7 @@ public: void set_termios(const Unix::termios&); bool should_generate_signals() const { return m_termios.c_lflag & ISIG; } bool should_echo_input() const { return m_termios.c_lflag & ECHO; } + bool in_canonical_mode() const { return m_termios.c_lflag & ICANON; } protected: virtual bool isTTY() const final override { return true; }