Kernel: Make backspace \b and delete 0x7F

This is what `vim` seems to expect and imo makes way more sense.
This commit is contained in:
2024-12-05 14:07:48 +02:00
parent 72d9e4c1e7
commit 51b6329c86
5 changed files with 23 additions and 29 deletions

View File

@@ -285,14 +285,6 @@ namespace Kernel
void TTY::do_backspace()
{
auto print_backspace =
[this]
{
putchar('\b');
putchar(' ');
putchar('\b');
};
if (m_output.bytes > 0)
{
uint8_t last = m_output.buffer[m_output.bytes - 1];
@@ -308,20 +300,20 @@ namespace Kernel
}
ASSERT(m_output.bytes > 0);
m_output.bytes--;
print_backspace();
putchar('\b');
}
// Caret notation
else if (last < 32 || last == 127)
{
m_output.bytes--;
print_backspace();
print_backspace();
putchar('\b');
putchar('\b');
}
// Ascii
else
{
m_output.bytes--;
print_backspace();
putchar('\b');
}
}
}