summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 05:22:35 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commite9eae368dbbe855ad2f409913ff0d44d5ac32bd8 (patch)
treea72ba7ecd7051d72f7685e948205d7d60aa44b21 /src/exec.zig
parent5002c612298fe645791218059a69d2bc80a42d2d (diff)
downloadpardes-e9eae368dbbe855ad2f409913ff0d44d5ac32bd8.tar.gz
pardes-e9eae368dbbe855ad2f409913ff0d44d5ac32bd8.zip
Tty takes a directory as long as a path may be
A terminal's directory rode inline in the spawn effect, capped at 256 bytes, so Tty in a directory of about 377 bytes said path too long. A directory past the inline buffer now goes out of line (Pardes.spawn_dirs, given to the host when the spawn is performed), up to the host's path limit (4095); past that, Tty says its directory is longer than a path may be. The effect queue stays its size. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/exec.zig b/src/exec.zig
index 73413910..c2d1be21 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -348,6 +348,10 @@ fn spawnTtyWithMount(p: *Pardes, from: usize, v9fs: bool) ?*Pane {
return null;
};
const nt = p.newShell(free, p.execDir(from)) catch |err| {
+ if (err == error.PathTooLong) {
+ p.reportFailure(from, std.fmt.comptimePrint("Tty: its directory is longer than a path may be ({d} bytes)", .{pardes.memory.limits.host_path_cap}));
+ return null;
+ }
p.reportError(from, "Tty", err);
return null;
};
@@ -663,7 +667,7 @@ fn runCommand(p: *Pardes, from: usize, line: []const u8) ?usize {
if (panes.Terminal.onAlternateScreen(pane)) panes.Terminal.feedOutput(p, pane, "\x1b[?1049l");
panes.Terminal.feedOutput(p, pane, "\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l\x1b[?2004l\x1b[?25h\x1b[0m");
echoCommand(p, pane, line);
- p.emit(.{ .spawn = .{ .pane = @intCast(id), .serial = pane.serial, .cwd = .from(pane.cwdSlice()) } });
+ p.emitSpawn(id, pane.serial, pane.cwdSlice());
noteRun(p, pane, "run", line);
return id;
}