From 5d80debc1f891cacb155aa7eaaad51a9a3325ec9 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Mon, 17 May 2021 16:25:35 +0200 Subject: 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 --- Kernel/TTY/VirtualConsole.cpp | 6 +----- Kernel/TTY/VirtualConsole.h | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'Kernel') 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&); -- cgit v1.2.3