From 83046a05d4e43ab215ed986a17b949e24a136618 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 29 Jul 2025 10:04:30 +0200 Subject: [PATCH] Don't kill processes in RunAndProcessLines As we just did for tasks, close their stdout pipe instead. This makes the called process terminate more gracefully. This isn't a change that we *need* to make, it's just a bit nicer. --- pkg/commands/oscommands/cmd_obj_runner.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/commands/oscommands/cmd_obj_runner.go b/pkg/commands/oscommands/cmd_obj_runner.go index 824ce6d52..34430b2ae 100644 --- a/pkg/commands/oscommands/cmd_obj_runner.go +++ b/pkg/commands/oscommands/cmd_obj_runner.go @@ -171,16 +171,17 @@ func (self *cmdObjRunner) RunAndProcessLines(cmdObj *CmdObj, onLine func(line st line := scanner.Text() stop, err := onLine(line) if err != nil { + stdoutPipe.Close() return err } if stop { - _ = Kill(cmd) + stdoutPipe.Close() // close the pipe so that the called process terminates break } } if scanner.Err() != nil { - _ = Kill(cmd) + stdoutPipe.Close() return scanner.Err() }