mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
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:
@ -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),
|
||||||
|
Reference in New Issue
Block a user