diff --git a/cmd/gh/main.go b/cmd/gh/main.go index e8471da8d..bb399f1a5 100644 --- a/cmd/gh/main.go +++ b/cmd/gh/main.go @@ -236,7 +236,7 @@ func shouldCheckForUpdate() bool { if os.Getenv("CODESPACES") != "" { return false } - return updaterEnabled != "" && !isCI() && !isCompletionCommand() && utils.IsTerminal(os.Stderr) + return updaterEnabled != "" && !isCI() && utils.IsTerminal(os.Stdout) && utils.IsTerminal(os.Stderr) } // based on https://github.com/watson/ci-info/blob/HEAD/index.js @@ -246,10 +246,6 @@ func isCI() bool { os.Getenv("RUN_ID") != "" // TaskCluster, dsari } -func isCompletionCommand() bool { - return len(os.Args) > 1 && os.Args[1] == "completion" -} - func checkForUpdate(currentVersion string) (*update.ReleaseInfo, error) { if !shouldCheckForUpdate() { return nil, nil