summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index d06897ff..19d16e1e 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -419,6 +419,21 @@ pub const Kill = struct {
var jobless = false;
for (c.p.panes, 0..) |slot, id| {
const pane = slot orelse continue;
+ // A command pane's child is the command: the whole of its
+ // process group goes, as acme's Kill ends the process.
+ if (pane.command) |line| if (!pane.command_done) {
+ const said = std.mem.trim(u8, line, " \t");
+ const first = said[0 .. std.mem.indexOfAny(u8, said, " \t") orelse said.len];
+ if (names.len > 0) {
+ var words = std.mem.tokenizeAny(u8, names, " \t");
+ while (words.next()) |w| {
+ if (std.mem.eql(u8, w, first)) break;
+ } else continue;
+ }
+ c.p.emit(.{ .signal_pty = .{ .pane = @intCast(id), .sig = .term } });
+ stopped = true;
+ continue;
+ };
if (!panes.Terminal.commandRunning(pane)) continue;
const sent = pane.sent_command.?;
if (names.len > 0) {