Skip to content

Commit 50095d3

Browse files
Refuse to start if the terminal size is reported with 0 dimension
1 parent f0bd3d6 commit 50095d3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub fn raw_mode_start() !void {
5151

5252
var ws: std.posix.winsize = undefined;
5353
const err = std.posix.system.ioctl(stdin_reader.handle, std.posix.T.IOCGWINSZ, @intFromPtr(&ws));
54-
if (std.posix.errno(err) != .SUCCESS) {
54+
if (std.posix.errno(err) != .SUCCESS or ws.ws_col == 0 or ws.ws_row == 0) {
5555
return error.GetTerminalSizeErr;
5656
}
5757
term_width = ws.ws_col;

0 commit comments

Comments
 (0)