1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:08:13 +00:00

LibVT+Everywhere: Introduce 'automarks' and 'clear previous command'

Automarks are similar to bookmarks placed by the terminal, allowing the
user to selectively remove a single command and its output from the
terminal scrollback.
This commit implements a single way to add marks: automatically placing
them when the shell becomes interactive.

To make sure the shell behaves correctly after its expected prompt
position changes, the terminal layer forces a resize event to be passed
to the shell on such (possibly) partial clears; this also has the nice
side effect of fixing the disappearing prompt on the preexisting "clear
including history" action: Fixes #4192.
This commit is contained in:
Ali Mohammad Pur 2024-02-06 01:41:35 +03:30 committed by Ali Mohammad Pur
parent cde528fdd9
commit 54ab6fe5b9
12 changed files with 238 additions and 0 deletions

View file

@ -377,6 +377,11 @@ void VirtualConsole::terminal_history_changed(int)
// Do nothing, I guess?
}
void VirtualConsole::terminal_did_perform_possibly_partial_clear()
{
// Do nothing, we're not going to hit this anyway.
}
void VirtualConsole::emit(u8 const* data, size_t size)
{
for (size_t i = 0; i < size; i++)

View file

@ -99,6 +99,7 @@ private:
virtual void set_window_progress(int, int) override;
virtual void terminal_did_resize(u16 columns, u16 rows) override;
virtual void terminal_history_changed(int) override;
virtual void terminal_did_perform_possibly_partial_clear() override;
virtual void emit(u8 const*, size_t) override;
virtual void set_cursor_shape(VT::CursorShape) override;
virtual void set_cursor_blinking(bool) override;