diff options
Diffstat (limited to 'core/exec.zig')
| -rw-r--r-- | core/exec.zig | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/exec.zig b/core/exec.zig index 611e3430..fd2c6b1c 100644 --- a/core/exec.zig +++ b/core/exec.zig @@ -695,8 +695,8 @@ pub fn executeFrom(p: *Pardes, id: usize, txt: []const u8, from_body: bool) ?usi } // 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); + // terminal has the keyboard; Root's, one at the project's root. + if (p.exec_header or p.exec_root or !takesCommandLine(p, id)) return runCommand(p, id, cmd); // At a prompt with typed text below it: the output area padded with // newlines so the command's output does not overwrite the buffer. if (pane.ovl) |o| if (pane.isTerminal()) if (pane.terminal) |state| if (panes.Term.prompt(state).at_prompt) { @@ -741,11 +741,12 @@ pub fn runCommand(p: *Pardes, from: usize, line: []const u8) ?usize { // Not one whose pty a job it left behind still prints to: reusing it // 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 (layout.placeNew). + // as the new one goes in that column (layout.placeNew); Root's line, + // only one at the root. // Nor one leased: an open that was answered its serial and is still // open reads that pane's output, which another client's command must // not replace; a new pane runs it instead. - 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 and !leased(p, src.?.serial)) from else for (p.panes, 0..) |slot, i| { + const reuse: ?usize = if (!p.exec_header and !p.exec_root and p.exec_column == null and src != null and src.?.command != null and src.?.command_done and !src.?.command_pty and !leased(p, src.?.serial)) 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) and !leased(p, other.serial)) break i; |
