From 406f9809cd69c1bcd69cdfc752b32e2a2e4e76c0 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 22:58:58 -0300 Subject: pty/ctl: its stat counted the grid's `winsize` while its read says the size a winsize write set (14 bytes against 15 after `winsize 132 44`), and a mount reads up to the stat: both now come from pty.winsize; the every-verb test checks the stat Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/ninep/pane.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ninep/pane.zig') diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig index d1668dd7..c12b2e80 100644 --- a/src/ninep/pane.zig +++ b/src/ninep/pane.zig @@ -380,8 +380,10 @@ pub fn fileSize(p: *Pardes, id: usize, f: PaneFile) u64 { .pty_status => pty.status_len, .pty_ctl => pty_ctl: { var buf: [32]u8 = undefined; + // The size a read says: what winsize set, else the grid. + const size = pty.winsize(pane); // unreachable: two u16s and 9 bytes fit 32 - break :pty_ctl (std.fmt.bufPrint(&buf, "winsize {d} {d}\n", .{ pane.cols, pane.rows }) catch unreachable).len; + break :pty_ctl (std.fmt.bufPrint(&buf, "winsize {d} {d}\n", .{ size[0], size[1] }) catch unreachable).len; }, .pty_data => if (pf.pty_out.peek()) |chunk| chunk.len else 0, .dir, .errors, .pty, .pty_run => 0, -- cgit v1.3