diff options
Diffstat (limited to 'TUI/module.jai')
| -rw-r--r-- | TUI/module.jai | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/TUI/module.jai b/TUI/module.jai index c8a5512..044fd65 100644 --- a/TUI/module.jai +++ b/TUI/module.jai @@ -43,6 +43,10 @@ Commands :: struct { ClearScreen :: "\e[2J"; ClearLine :: "\e[2K"; + Bell :: "\x07"; + + SetWindowTitle :: "\e]0;%\x07"; + RefreshWindow :: "\e[7t"; // TODO Not yet tested. SetUTF8 :: "\e%G"; // TODO TEST ME PLEASE @@ -99,6 +103,10 @@ input_override : Key; row := 5; +assert_is_initialized :: inline () { + assert(initialized, "TUI is not ready."); +} + set_next_key :: (key: Key) { input_override = key; } @@ -392,6 +400,11 @@ get_cursor_position :: () -> row: int, column: int { return row, column; } +set_terminal_title :: (title: string) { + assert_is_initialized(); + print(Commands.SetWindowTitle, title); +} + #if OS == .WINDOWS { // Prototyping zone... keep clear! |
