diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2021-05-17 16:25:35 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-17 18:19:49 +0200 |
commit | 5d80debc1f891cacb155aa7eaaad51a9a3325ec9 (patch) | |
tree | a57c6b63fac9ae058f961941a336b7e97b11c881 /Kernel | |
parent | f25209113fcd15df5778938c4accf13c5139d278 (diff) | |
download | serenity-5d80debc1f891cacb155aa7eaaad51a9a3325ec9.zip |
LibVT: Fix newline handling
Before this commit, we would jump to the first column after receiving
the '\n' line feed character. This is not the correct behavior, as it
should only move the cursor now. Translating the typed Return key into
the correct CR LF ("\r\n") is the TTY's job, which was fixed in #7184.
Fixes #6820
Fixes #6960
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/TTY/VirtualConsole.cpp | 6 | ||||
-rw-r--r-- | Kernel/TTY/VirtualConsole.h | 3 |
2 files changed, 2 insertions, 7 deletions
diff --git a/Kernel/TTY/VirtualConsole.cpp b/Kernel/TTY/VirtualConsole.cpp index 00dd68067e..350f075b2c 100644 --- a/Kernel/TTY/VirtualConsole.cpp +++ b/Kernel/TTY/VirtualConsole.cpp @@ -68,7 +68,7 @@ void ConsoleImpl::scroll_up() void ConsoleImpl::scroll_down() { } -void ConsoleImpl::newline() +void ConsoleImpl::linefeed() { u16 new_row = m_cursor_row; u16 max_row = rows() - 1; @@ -383,10 +383,6 @@ void VirtualConsole::scroll_up() m_console_impl.m_need_full_flush = true; } -void VirtualConsole::newline() -{ -} - void VirtualConsole::clear_line(size_t y_index) { m_lines[y_index].dirty = true; diff --git a/Kernel/TTY/VirtualConsole.h b/Kernel/TTY/VirtualConsole.h index c36bf5da17..be1db45329 100644 --- a/Kernel/TTY/VirtualConsole.h +++ b/Kernel/TTY/VirtualConsole.h @@ -38,7 +38,7 @@ private: virtual void scroll_up() override; virtual void scroll_down() override; - virtual void newline() override; + virtual void linefeed() override; virtual void put_character_at(unsigned row, unsigned column, u32 ch) override; virtual void set_window_title(const String&) override; @@ -137,7 +137,6 @@ private: void scroll_down(); void scroll_up(); - void newline(); void clear_line(size_t index); void put_character_at(unsigned row, unsigned column, u32 ch, const VT::Attribute&); |