mod(app): automatically hide cursor when running fullscreen tui's
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 37s

This commit is contained in:
2024-11-11 13:32:39 +01:00
parent 1544a4d2ff
commit 8b3f863404
2 changed files with 10 additions and 0 deletions

View File

@@ -43,6 +43,14 @@ pub fn clearScreen() !void {
_ = try std.posix.write(std.posix.STDIN_FILENO, "\x1b[2J");
}
pub fn hideCursor() !void {
_ = try std.posix.write(std.posix.STDIN_FILENO, "\x1b[?25l");
}
pub fn showCursor() !void {
_ = try std.posix.write(std.posix.STDIN_FILENO, "\x1b[?25h");
}
pub fn setCursorPositionHome() !void {
_ = try std.posix.write(std.posix.STDIN_FILENO, "\x1b[H");
}