From e9f4b77276f1f4cba8e7ca42894ed536af78119b Mon Sep 17 00:00:00 2001 From: verse91 Date: Sun, 10 May 2026 00:53:39 +0700 Subject: [PATCH] chore(wrapper): add background update --- root/wrapper.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/root/wrapper.go b/root/wrapper.go index 2f5e267..eeaceb0 100644 --- a/root/wrapper.go +++ b/root/wrapper.go @@ -149,6 +149,10 @@ func runWrapper() { overlay := integration.NewOverlay() + // start background update check (async) + pendingUpdate = startBackgroundUpdateCheck() + updatePrinted := false + // bridge pty output to actual stdout go func() { buf := make([]byte, 4096) @@ -201,6 +205,17 @@ func runWrapper() { query := scanner.Text() 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 }