From 8b834c1588bef8de89e0ea3c9b584622daf89af9 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Tue, 6 Aug 2024 13:41:41 -0500 Subject: [PATCH] cli/list-keybinds: set default winsize for windows When on windows, set some default terminal size. The actual size is not very important to our use case here, but we do need one --- src/cli/list_keybinds.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli/list_keybinds.zig b/src/cli/list_keybinds.zig index f61058258..79ef62ba1 100644 --- a/src/cli/list_keybinds.zig +++ b/src/cli/list_keybinds.zig @@ -92,7 +92,8 @@ fn prettyPrint(alloc: Allocator, keybinds: Config.Keybinds) !u8 { const writer = buf_writer.writer().any(); const winsize: vaxis.Winsize = switch (builtin.os.tag) { - .windows => {}, // TODO from environment ($LINES and $COLUMNS) + .windows => .{ .rows = 24, .cols = 120 }, // We use some default, it doesn't really matter + // for what we are doing since wrapping will occur anyways else => try vaxis.Tty.getWinsize(tty.fd), }; try vx.resize(alloc, tty.anyWriter(), winsize);