summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew Stratford <drewstratford@outlook.com>2019-10-31 01:11:41 +1300
committerAndreas Kling <awesomekling@gmail.com>2019-10-30 14:35:39 +0100
commit378480e8e4de5fe94324d59ef809cdb63ef44f9b (patch)
tree015a564518456e0a030bc34c889cc377ae2f50e8
parented45f67c000af65fe9ea98a72750b39a9fbe41cf (diff)
downloadserenity-378480e8e4de5fe94324d59ef809cdb63ef44f9b.zip
TTY: Properly implement echo in VirtualConsole.
VirtualConsole::echo now actually echoes characters instead of doing nothing.
-rw-r--r--Kernel/TTY/VirtualConsole.cpp7
-rw-r--r--Kernel/TTY/VirtualConsole.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/Kernel/TTY/VirtualConsole.cpp b/Kernel/TTY/VirtualConsole.cpp
index 1b3336823d..36566cf418 100644
--- a/Kernel/TTY/VirtualConsole.cpp
+++ b/Kernel/TTY/VirtualConsole.cpp
@@ -545,6 +545,13 @@ StringView VirtualConsole::tty_name() const
return m_tty_name;
}
+void VirtualConsole::echo(u8 ch)
+{
+ if (should_echo_input()) {
+ on_tty_write(&ch, 1);
+ }
+}
+
void VirtualConsole::set_vga_start_row(u16 row)
{
m_vga_start_row = row;
diff --git a/Kernel/TTY/VirtualConsole.h b/Kernel/TTY/VirtualConsole.h
index d62b98c76e..a1021e8b58 100644
--- a/Kernel/TTY/VirtualConsole.h
+++ b/Kernel/TTY/VirtualConsole.h
@@ -33,7 +33,7 @@ private:
// ^TTY
virtual ssize_t on_tty_write(const u8*, ssize_t) override;
virtual StringView tty_name() const override;
- virtual void echo(u8) override { return; }
+ virtual void echo(u8) override;
// ^CharacterDevice
virtual const char* class_name() const override { return "VirtualConsole"; }