diff options
| author | dam <dam@gudinoff> | 2024-04-16 10:10:59 +0100 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2024-04-16 10:10:59 +0100 |
| commit | b8d743d5b307e0c230ebdb2fe314e041483d6a14 (patch) | |
| tree | 83bc8a7e907857175ef0cb67f45a6f1694655b1f /modules/TUI/module.jai | |
| parent | bc297bfa329b31f252cc115c6a4342548da2aeaf (diff) | |
| download | task-time-tracker-b8d743d5b307e0c230ebdb2fe314e041483d6a14.tar.zst task-time-tracker-b8d743d5b307e0c230ebdb2fe314e041483d6a14.zip | |
Adding error logging on TUI/unix.
Diffstat (limited to 'modules/TUI/module.jai')
| -rw-r--r-- | modules/TUI/module.jai | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/TUI/module.jai b/modules/TUI/module.jai index b5866d5..5fd29f6 100644 --- a/modules/TUI/module.jai +++ b/modules/TUI/module.jai @@ -1,5 +1,7 @@ #module_parameters(COLOR_MODE := 24); +#scope_file + #if OS == { case .LINUX; #load "unix.jai"; @@ -22,6 +24,8 @@ assert(input_buffer.count >= KEY_SIZE, "The input buffer size must be capable to hold an entire Key, which should be able to hold an UTF8 code (4 bytes) or a terminal escape code (6 bytes)."); } +#scope_export; + // Special Graphics Characters Drawings :: struct { Blank :: "\x5F"; @@ -441,7 +445,7 @@ read_input_line :: (count_limit: int, is_visible: bool = true) -> string, Key { // > https://unix.stackexchange.com/questions/255707/what-are-the-keyboard-shortcuts-for-the-command-line x, y := get_cursor_position(); - write_strings(Commands.StartBlinking, Commands.BlinkingBarShape); + write_strings(Commands.ShowCursor, Commands.StartBlinking, Commands.BlinkingBarShape); key := Keys.None; while true { @@ -515,7 +519,7 @@ read_input_line :: (count_limit: int, is_visible: bool = true) -> string, Key { } } - write_strings(Commands.StopBlinking, Commands.DefaultShape); + write_strings(Commands.StopBlinking, Commands.DefaultShape, Commands.HideCursor); result := ifx key == Keys.Enter then str else ""; return result, key; |
