mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +00:00
Kernel: Make ^W and ^U actually erase characters
This is quite hackish but it makes using the js REPL a lot nicer. :^)
This commit is contained in:
parent
5ba8247cbb
commit
f3c245fb96
|
@ -221,7 +221,7 @@ void TTY::erase_word()
|
|||
if (ch != ' ')
|
||||
first_char = true;
|
||||
m_input_buffer.dequeue_end();
|
||||
echo(m_termios.c_cc[VERASE]);
|
||||
erase_character();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -229,10 +229,17 @@ void TTY::kill_line()
|
|||
{
|
||||
while (can_do_backspace()) {
|
||||
m_input_buffer.dequeue_end();
|
||||
echo(m_termios.c_cc[VERASE]);
|
||||
erase_character();
|
||||
}
|
||||
}
|
||||
|
||||
void TTY::erase_character()
|
||||
{
|
||||
echo(m_termios.c_cc[VERASE]);
|
||||
echo(' ');
|
||||
echo(m_termios.c_cc[VERASE]);
|
||||
}
|
||||
|
||||
void TTY::generate_signal(int signal)
|
||||
{
|
||||
if (!pgid())
|
||||
|
|
|
@ -74,6 +74,7 @@ protected:
|
|||
bool can_do_backspace() const;
|
||||
void do_backspace();
|
||||
void erase_word();
|
||||
void erase_character();
|
||||
void kill_line();
|
||||
void flush_input();
|
||||
|
||||
|
|
Loading…
Reference in a new issue