diff options
| author | dam <dam@gudinoff> | 2023-12-08 03:13:32 +0000 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2023-12-08 03:13:32 +0000 |
| commit | f0aab177c96c6bda25927f4b748c39f2847df47a (patch) | |
| tree | 82e60181ab2fc1aeee054611c2bf3a6325b63c99 /TUI/unix.jai | |
| parent | 7945094deb5cb6bac24a2ec96a4cc3bc0d64b6c8 (diff) | |
| parent | c61e13ae21cbac7b6642d2d813245c7fc0575834 (diff) | |
| download | task-time-tracker-f0aab177c96c6bda25927f4b748c39f2847df47a.tar.zst task-time-tracker-f0aab177c96c6bda25927f4b748c39f2847df47a.zip | |
Merge changes from black and red.
Diffstat (limited to 'TUI/unix.jai')
| -rw-r--r-- | TUI/unix.jai | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/TUI/unix.jai b/TUI/unix.jai index 4aa0508..2c34122 100644 --- a/TUI/unix.jai +++ b/TUI/unix.jai @@ -39,6 +39,9 @@ // https://codebrowser.dev/glibc/glibc/sysdeps/unix/sysv/linux/tcgetattr.c.html tcgetattr :: (fd: s32, termios_p: *Terminal_IO_Mode) -> s32 #foreign libc; + // https://codebrowser.dev/glibc/glibc/sysdeps/unix/sysv/linux/tcflush.c.html + tcflush :: (fd: s32, queue_selector: s32) -> s32 #foreign libc; + // Information for the termios.h enums is platform dependent and was retrieved from: // https://elixir.bootlin.com/glibc/latest/source/sysdeps/unix/sysv/linux/bits/termios.h @@ -178,6 +181,11 @@ restore_resize_handler :: () { #scope_export +OS_flush_input :: inline () { + TCIFLUSH :: 0; // TODO Is this always zero in all systems? + tcflush(STDIN_FILENO, TCIFLUSH); +} + OS_prepare_terminal :: () { tcgetattr(STDIN_FILENO, *initial_tio_mode); // TODO Log on error. raw_tio_mode = initial_tio_mode; |
