Merge branch 'main' into refactor/web-darwin-no-cgo

This commit is contained in:
wenjie 2026-03-17 20:10:31 +08:00 committed by GitHub
commit 1f2d473155
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,32 @@
//go:build darwin && !cgo
package main
import (
"context"
"os"
"os/signal"
"syscall"
"time"
"github.com/sipeed/picoclaw/pkg/logger"
)
func runTray() {
logger.Infof("System tray is unavailable in darwin builds without cgo; running without tray")
if !*noBrowser {
go func() {
time.Sleep(browserDelay)
if err := openBrowser(); err != nil {
logger.Errorf("Warning: Failed to auto-open browser: %v", err)
}
}()
}
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
<-ctx.Done()
shutdownApp()
}