Terminal: Add utf8 parsing for input

This patch adds possibility to render multibyte utf8 codepoints!
This commit is contained in:
2024-08-11 00:54:51 +03:00
parent bac3219a01
commit f08d429851
2 changed files with 43 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ public:
private:
void handle_csi(char ch);
void handle_sgr();
void putchar(uint32_t codepoint);
void putchar(uint8_t ch);
bool read_shell(int fd);
void on_key_event(LibGUI::EventPacket::KeyEvent);
@@ -58,6 +58,9 @@ private:
State m_state { State::Normal };
CSIInfo m_csi_info;
uint8_t m_utf8_index { 0 };
uint8_t m_utf8_bytes[4] { };
Cursor m_saved_cursor { 0, 0 };
uint32_t m_fg_color { 0xFFFFFF };
uint32_t m_bg_color { 0x000000 };