Add animation detection support to test runner

This commit is contained in:
Feoramund
2025-05-20 19:28:07 -04:00
parent 3c40a54dcd
commit 1b407ef207
2 changed files with 80 additions and 61 deletions
+5 -3
View File
@@ -63,9 +63,11 @@ stop_test_callback :: proc "c" (sig: libc.int) {
// NOTE(Feoramund): Using these write calls in a signal handler is
// undefined behavior in C99 but possibly tolerated in POSIX 2008.
// Either way, we may as well try to salvage what we can.
show_cursor := ansi.CSI + ansi.DECTCEM_SHOW
libc.fwrite(raw_data(show_cursor), size_of(byte), len(show_cursor), libc.stdout)
libc.fflush(libc.stdout)
if !global_ansi_disabled {
show_cursor := ansi.CSI + ansi.DECTCEM_SHOW
libc.fwrite(raw_data(show_cursor), size_of(byte), len(show_cursor), libc.stdout)
libc.fflush(libc.stdout)
}
// This is an attempt at being compliant by avoiding printf.
sigbuf: [8]byte