aboutsummaryrefslogtreecommitdiff
path: root/modules/TUI/module.jai
diff options
context:
space:
mode:
Diffstat (limited to 'modules/TUI/module.jai')
-rw-r--r--modules/TUI/module.jai8
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;