summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/exec.zig b/src/exec.zig
index be8dc46b..ece4f98d 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -712,7 +712,7 @@ pub fn executeFrom(p: *Pardes, id: usize, txt: []const u8, from_body: bool) ?usi
/// is done, else a new one, placed as layout.placeNew places a command pane.
/// A pane reused keeps what it showed: the new command runs below a line
/// naming it, as acme appends to +Errors and never clears it (util.c:213).
-fn runCommand(p: *Pardes, from: usize, line: []const u8) ?usize {
+pub fn runCommand(p: *Pardes, from: usize, line: []const u8) ?usize {
if (line.len > command_max) {
p.reportFailure(from, "exec: a command line is at most 1024 bytes");
return null;
@@ -735,7 +735,7 @@ fn runCommand(p: *Pardes, from: usize, line: []const u8) ?usize {
// 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_column == null and p.exec_dir == 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;