Skip to content

Commit ed9519a

Browse files
brandondongjesseduffield
authored andcommitted
Suppress error logs when killing process on Windows
There is a string check here to suppress the failure logs due to this reason but on Windows, the string is different ("exit status 1").
1 parent 7731311 commit ed9519a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/tasks/tasks.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,10 @@ func (self *ViewBufferManager) NewCmdTask(start func() (*exec.Cmd, io.Reader), p
277277
refreshViewIfStale()
278278

279279
if err := cmd.Wait(); err != nil {
280-
// it's fine if we've killed this program ourselves
281-
if !strings.Contains(err.Error(), "signal: killed") {
280+
select {
281+
case <-opts.Stop:
282+
// it's fine if we've killed this program ourselves
283+
default:
282284
self.Log.Errorf("Unexpected error when running cmd task: %v; Failed command: %v %v", err, cmd.Path, cmd.Args)
283285
}
284286
}

0 commit comments

Comments
 (0)