chore(wrapper): add background update

This commit is contained in:
verse91
2026-05-10 00:53:39 +07:00
parent 1e923a13d9
commit e9f4b77276
+15
View File
@@ -149,6 +149,10 @@ func runWrapper() {
overlay := integration.NewOverlay() overlay := integration.NewOverlay()
// start background update check (async)
pendingUpdate = startBackgroundUpdateCheck()
updatePrinted := false
// bridge pty output to actual stdout // bridge pty output to actual stdout
go func() { go func() {
buf := make([]byte, 4096) buf := make([]byte, 4096)
@@ -201,6 +205,17 @@ func runWrapper() {
query := scanner.Text() query := scanner.Text()
if query == "IRIS_CMD_STOP" { if query == "IRIS_CMD_STOP" {
// hook: after user executes a command, print the update notice exactly once per session
if !updatePrinted {
select {
case result, ok := <-pendingUpdate:
if ok && result.hasUpdate {
printUpdateNotice(result.latestVersion)
updatePrinted = true
}
default:
}
}
continue continue
} }