Skip to content

fix: set CREATE_NO_WINDOW on tzutil exec to prevent console flash#15

Open
williammartin wants to merge 1 commit into
thlib:mainfrom
williammartin:fix/suppress-tzutil-console-window
Open

fix: set CREATE_NO_WINDOW on tzutil exec to prevent console flash#15
williammartin wants to merge 1 commit into
thlib:mainfrom
williammartin:fix/suppress-tzutil-console-window

Conversation

@williammartin
Copy link
Copy Markdown

@williammartin williammartin commented May 13, 2026

Description

Fixes #16

No worries if you just want to close it, but I thought I'd just open a PR to demonstrate the proposed fix. Cheers.

When the calling process has no console (e.g. spawned with
DETACHED_PROCESS), tzutil.exe allocates a fresh conhost on first
stdio access, producing a visible window flash.

Setting CREATE_NO_WINDOW gives tzutil a non-visible console,
preventing the flash while still allowing cmd.Output() to capture
the result via pipes.

golang.org/x/sys is already in the module graph via
golang.org/x/sys/windows/registry, so no new dependency is added.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Console window flash when parent process has no console on Windows

1 participant