From ed9519a241be00a36e43e382b82a46c2f247ffd0 Mon Sep 17 00:00:00 2001
From: Brandon <brandondong96@gmail.com>
Date: Tue, 4 Feb 2025 17:12:47 -0800
Subject: [PATCH] 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").
---
 pkg/tasks/tasks.go | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pkg/tasks/tasks.go b/pkg/tasks/tasks.go
index b488152a5..965875349 100644
--- a/pkg/tasks/tasks.go
+++ b/pkg/tasks/tasks.go
@@ -277,8 +277,10 @@ func (self *ViewBufferManager) NewCmdTask(start func() (*exec.Cmd, io.Reader), p
 			refreshViewIfStale()
 
 			if err := cmd.Wait(); err != nil {
-				// it's fine if we've killed this program ourselves
-				if !strings.Contains(err.Error(), "signal: killed") {
+				select {
+				case <-opts.Stop:
+					// it's fine if we've killed this program ourselves
+				default:
 					self.Log.Errorf("Unexpected error when running cmd task: %v; Failed command: %v %v", err, cmd.Path, cmd.Args)
 				}
 			}