set a minimum window size

Fixes #4

The currently picked 10x4 is somewhat arbitrary but matches
Terminal.app. We can make this configurable.
This commit is contained in:
Mitchell Hashimoto
2022-08-09 08:59:45 -07:00
parent febec6f91b
commit 57cec33303

View File

@ -219,6 +219,13 @@ pub fn create(alloc: Allocator, loop: libuv.Loop, config: *const Config) !*Windo
.b = config.foreground.b, .b = config.foreground.b,
}; };
// Set a minimum size that is cols=10 h=4. This matches Mac's Terminal.app
// but is otherwise somewhat arbitrary.
try window.setSizeLimits(.{
.width = @floatToInt(u32, grid.cell_size.width * 10),
.height = @floatToInt(u32, grid.cell_size.height * 4),
}, .{ .width = null, .height = null });
// Create our pty // Create our pty
var pty = try Pty.open(.{ var pty = try Pty.open(.{
.ws_row = @intCast(u16, grid.size.rows), .ws_row = @intCast(u16, grid.size.rows),