From 6a815117d242688c947a1788e4ffda9ff2bce959 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 20:57:49 -0300 Subject: A shell command from the workspace's or a column's tag runs as a command pane in the session's directory, never typed into the terminal with the keyboard A command clicked in a header tag, or written to /tagexec or a column's exec, was typed into the active terminal when it sat at an empty prompt, so it ran in that pane's directory and left no run or exit record. It now always gets a command pane of its own in the session's directory, as acme's row and column tags have no directory but the session's. tags.md writes the rule down: pane words act on the column's active pane, a column's words on the column, shell commands as their own panes, and over 9P a pane's word is refused. Co-Authored-By: Claude Opus 5.5 --- src/exec.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/exec.zig') diff --git a/src/exec.zig b/src/exec.zig index ea20f969..2b3ca40c 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -728,7 +728,10 @@ pub fn executeFrom(p: *Pardes, id: usize, txt: []const u8, from_body: bool) ?usi p.reportFailure(id, std.fmt.bufPrint(&said, "{s} is {s}, invalid here", .{ word, why }) catch "GUI-only, invalid here"); return null; } - if (!takesCommandLine(p, id)) return runCommand(p, id, cmd); + // A command from a column's or the workspace's tag is that tag's: a + // command pane in the session's directory, never typed into whichever + // terminal has the keyboard. + if (p.exec_header or !takesCommandLine(p, id)) return runCommand(p, id, cmd); panes.terminal.padOutputBelowEdits(p, id); panes.terminal.noteCommand(pane, cmd); if (panes.terminal.queuePendingCommand(pane, cmd) catch |err| { @@ -771,7 +774,7 @@ fn runCommand(p: *Pardes, from: usize, line: []const u8) ?usize { // would hang that job up. // From a column's tag, only a finished pane in that column is reused, // as the new one goes in that column (placeNew). - const reuse: ?usize = if (p.exec_column == null and src != null and src.?.command != null and src.?.command_done and !src.?.command_pty) from else for (p.panes, 0..) |slot, i| { + const reuse: ?usize = if (!p.exec_header and p.exec_column == null and src != null and src.?.command != null and src.?.command_done and !src.?.command_pty) from else for (p.panes, 0..) |slot, i| { const other = slot orelse continue; if (p.exec_column) |c| if (if (layout.findPane(p, i)) |f| f.col != c else true) continue; if (other.command != null and other.command_done and !other.command_pty and std.mem.eql(u8, other.cwdSlice(), dir)) break i; -- cgit v1.3