mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:27:35 +00:00
LibVT+Kernel: Add support for setting cursor styles
This commit introduces support for 3 new escape sequences: 1. Stop blinking cursor mode 2. `DECTCEM` mode (enable/disable cursor) 3. `DECSCUSR` (set cursor style) `TerminalWidget` now supports the following cursor types: block, underline and vertical bar. Each of these can blink or be steady. `VirtualConsole` ignores these (just as we were doing before).
This commit is contained in:
parent
7dfc804d7d
commit
875a2cbb71
6 changed files with 162 additions and 14 deletions
|
@ -26,6 +26,16 @@ class VirtualConsole;
|
|||
|
||||
namespace VT {
|
||||
|
||||
enum CursorStyle {
|
||||
None,
|
||||
BlinkingBlock,
|
||||
SteadyBlock,
|
||||
BlinkingUnderline,
|
||||
SteadyUnderline,
|
||||
BlinkingBar,
|
||||
SteadyBar
|
||||
};
|
||||
|
||||
class TerminalClient {
|
||||
public:
|
||||
virtual ~TerminalClient() { }
|
||||
|
@ -36,6 +46,7 @@ public:
|
|||
virtual void terminal_did_resize(u16 columns, u16 rows) = 0;
|
||||
virtual void terminal_history_changed() = 0;
|
||||
virtual void emit(const u8*, size_t) = 0;
|
||||
virtual void set_cursor_style(CursorStyle) = 0;
|
||||
};
|
||||
|
||||
class Terminal : public EscapeSequenceExecutor {
|
||||
|
@ -238,6 +249,9 @@ protected:
|
|||
// DSR - Device Status Reports
|
||||
void DSR(Parameters);
|
||||
|
||||
// DECSCUSR - Set Cursor Style
|
||||
void DECSCUSR(Parameters);
|
||||
|
||||
#ifndef KERNEL
|
||||
// ICH - Insert Character
|
||||
void ICH(Parameters);
|
||||
|
@ -319,6 +333,9 @@ protected:
|
|||
bool m_swallow_current { false };
|
||||
bool m_stomp { false };
|
||||
|
||||
CursorStyle m_cursor_style { BlinkingBlock };
|
||||
CursorStyle m_saved_cursor_style { BlinkingBlock };
|
||||
|
||||
Attribute m_current_attribute;
|
||||
Attribute m_saved_attribute;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue