add(style): cursor style to indicate a cursor position
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 25s

This commit is contained in:
2025-04-20 20:54:30 +02:00
parent a4293ff243
commit 50adf32f14
3 changed files with 13 additions and 2 deletions

View File

@@ -91,7 +91,7 @@ pub fn writer() Writer {
pub fn setCursorPosition(pos: Point) !void {
var buf: [64]u8 = undefined;
const value = try std.fmt.bufPrint(&buf, "\x1b[{d};{d}H", .{ pos.y, pos.x });
const value = try std.fmt.bufPrint(&buf, "\x1b[{d};{d}H", .{ pos.y + 1, pos.x + 1 });
_ = try std.posix.write(std.posix.STDIN_FILENO, value);
}