Terminal: Add cursor rendering

Cursor is now shown at the current position. It can be hidden (or shown)
with the ansi `\033[?25h` or `\033[?25l`
This commit is contained in:
2024-08-12 00:50:06 +03:00
parent 60b4d90608
commit 18e7cf2069
2 changed files with 54 additions and 1 deletions

View File

@@ -18,6 +18,9 @@ private:
void putchar(uint8_t ch);
bool read_shell();
void hide_cursor();
void show_cursor();
void on_key_event(LibGUI::EventPacket::KeyEvent);
void start_shell();
@@ -46,16 +49,20 @@ private:
{
int32_t fields[2];
size_t index;
bool question;
};
private:
BAN::UniqPtr<LibGUI::Window> m_window;
LibFont::Font m_font;
Cursor m_cursor { 0, 0 };
ShellInfo m_shell_info;
State m_state { State::Normal };
CSIInfo m_csi_info;
bool m_cursor_shown { true };
Cursor m_cursor { 0, 0 };
BAN::Vector<uint32_t> m_cursor_buffer;
uint8_t m_utf8_index { 0 };
uint8_t m_utf8_bytes[4] { };