From 3d9f22c115ac7680be0a97a5c3c715a902680ad8 Mon Sep 17 00:00:00 2001 From: adehad <26027314+adehad@users.noreply.github.com> Date: Sat, 9 May 2026 08:35:38 +0100 Subject: [PATCH] fix(telemetry): use CREATE_NO_WINDOW to prevent tzutil console flash on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DETACHED_PROCESS leaves the gh send-telemetry child with no console at all. When the transitive dependency thlib/go-timezone-local invokes `tzutil /g` to resolve the local IANA timezone, the console-subsystem tzutil binary allocates a fresh conhost — producing a visible window flash on every gh invocation, which accumulates as orphan terminals under terminal configurations that keep windows open on exit. CREATE_NO_WINDOW gives the child a non-visible console that descendants inherit, suppressing the flash. CREATE_NEW_PROCESS_GROUP is preserved so Ctrl+C still does not propagate to the detached telemetry child. Co-Authored-By: Claude Opus 4.7 (1M context) --- internal/telemetry/detach_windows.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/telemetry/detach_windows.go b/internal/telemetry/detach_windows.go index eb610163b..c4d62b307 100644 --- a/internal/telemetry/detach_windows.go +++ b/internal/telemetry/detach_windows.go @@ -10,7 +10,15 @@ import ( // detachAttrs returns SysProcAttr configured to place the child in its own // process group so that console signals (Ctrl+C) delivered to the parent's -// group are not forwarded to the child. +// group are not forwarded to the child, and to suppress any console window +// for the child and its descendants. +// +// CREATE_NO_WINDOW is preferred over DETACHED_PROCESS here: DETACHED_PROCESS +// removes the console entirely, which causes any console-subsystem descendant +// (e.g. tzutil.exe invoked transitively to resolve the local IANA timezone) +// to allocate a fresh conhost window, producing a visible flash on every gh +// invocation. CREATE_NO_WINDOW gives the child a non-visible console that +// descendants can inherit, avoiding the flash. func detachAttrs() *syscall.SysProcAttr { - return &syscall.SysProcAttr{CreationFlags: windows.CREATE_NEW_PROCESS_GROUP | windows.DETACHED_PROCESS} + return &syscall.SysProcAttr{CreationFlags: windows.CREATE_NEW_PROCESS_GROUP | windows.CREATE_NO_WINDOW} }