diff options
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 7 |
1 files changed, 5 insertions, 2 deletions
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; |
