Skip to content

Commit 115a8ec

Browse files
view: reap browser launcher; status: honor empty NO_COLOR
1 parent d80de32 commit 115a8ec

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

cmd/dotagents/report.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ func hasFile(path string) bool {
213213
type palette struct{ on bool }
214214

215215
func statusPalette() palette {
216-
if os.Getenv("NO_COLOR") != "" {
216+
// NO_COLOR opts out when present, regardless of value (https://no-color.org).
217+
if _, ok := os.LookupEnv("NO_COLOR"); ok {
217218
return palette{on: false}
218219
}
219220
info, err := os.Stdout.Stat()

cmd/dotagents/view.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ var openInBrowser = func(url string) error {
3636
default:
3737
cmd = exec.Command("xdg-open", url)
3838
}
39-
return cmd.Start()
39+
if err := cmd.Start(); err != nil {
40+
return err
41+
}
42+
// Reap the short-lived launcher (open/xdg-open/start) so it does not linger
43+
// as a zombie for the lifetime of the foreground `hk serve` session.
44+
go func() { _ = cmd.Wait() }()
45+
return nil
4046
}
4147

4248
const hkInstallHint = `HarnessKit (hk) not found on PATH.

0 commit comments

Comments
 (0)