1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

TTY: Implement Canonical mode and basic echoing.

The TTY driver now respects the ICANON flag, enabling basic line
editing like VKILL, VERASE, VEOF and VWERASE. Additionally,
ICANON is now set by default.

Basic echoing has can now be enabled via the ECHO flag, though
more complicated echoing like ECHOCTL or ECHONL has not been
implemented.
This commit is contained in:
Drew Stratford 2019-10-20 19:12:00 +13:00 committed by Andreas Kling
parent 67041f3a8c
commit 4c35c8d7fd
5 changed files with 148 additions and 4 deletions

View file

@ -30,6 +30,13 @@ StringView SlavePTY::tty_name() const
return m_tty_name;
}
void SlavePTY::echo(u8 ch)
{
if (should_echo_input()) {
m_master->on_slave_write(&ch, 1);
}
}
void SlavePTY::on_master_write(const u8* buffer, ssize_t size)
{
for (ssize_t i = 0; i < size; ++i)