1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:57:45 +00:00

Terminal: Implement basic history scrollback

This code needs some optimization work to reduce the amount of repaints
but the history feature basically works, which is cool :^)

Fixes #431.
This commit is contained in:
Andreas Kling 2019-08-19 19:12:34 +02:00
parent 462336ed49
commit 64f16c141d
2 changed files with 67 additions and 9 deletions

View file

@ -9,6 +9,8 @@
#include <LibGUI/GFrame.h>
#include <LibVT/Terminal.h>
class GScrollBar;
class TerminalWidget final : public GFrame
, public VT::TerminalClient {
C_OBJECT(TerminalWidget)
@ -51,6 +53,7 @@ private:
virtual void beep() override;
virtual void set_window_title(const StringView&) override;
virtual void terminal_did_resize(u16 columns, u16 rows) override;
virtual void terminal_history_changed() override;
Rect glyph_rect(u16 row, u16 column);
Rect row_rect(u16 row);
@ -58,6 +61,8 @@ private:
void update_cursor();
void invalidate_cursor();
Size compute_base_size() const;
VT::Terminal m_terminal;
VT::Position m_selection_start;
@ -88,4 +93,6 @@ private:
CTimer m_cursor_blink_timer;
CTimer m_visual_beep_timer;
RefPtr<CConfigFile> m_config;
GScrollBar* m_scrollbar { nullptr };
};