Skip to content

Commit 1e6bb88

Browse files
Merge pull request cli#13353 from adehad/fix/telemetry-windows-console-flash
fix(telemetry): prevent tzutil console flash on Windows
2 parents b88de96 + 3d9f22c commit 1e6bb88

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

internal/telemetry/detach_windows.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ import (
1010

1111
// detachAttrs returns SysProcAttr configured to place the child in its own
1212
// process group so that console signals (Ctrl+C) delivered to the parent's
13-
// group are not forwarded to the child.
13+
// group are not forwarded to the child, and to suppress any console window
14+
// for the child and its descendants.
15+
//
16+
// CREATE_NO_WINDOW is preferred over DETACHED_PROCESS here: DETACHED_PROCESS
17+
// removes the console entirely, which causes any console-subsystem descendant
18+
// (e.g. tzutil.exe invoked transitively to resolve the local IANA timezone)
19+
// to allocate a fresh conhost window, producing a visible flash on every gh
20+
// invocation. CREATE_NO_WINDOW gives the child a non-visible console that
21+
// descendants can inherit, avoiding the flash.
1422
func detachAttrs() *syscall.SysProcAttr {
15-
return &syscall.SysProcAttr{CreationFlags: windows.CREATE_NEW_PROCESS_GROUP | windows.DETACHED_PROCESS}
23+
return &syscall.SysProcAttr{CreationFlags: windows.CREATE_NEW_PROCESS_GROUP | windows.CREATE_NO_WINDOW}
1624
}

0 commit comments

Comments
 (0)