Skip to content

[codex] Hide git runner console windows on Windows#21

Merged
mariusvniekerk merged 2 commits into
mainfrom
codex/gitcmd-windows-no-window
Jun 12, 2026
Merged

[codex] Hide git runner console windows on Windows#21
mariusvniekerk merged 2 commits into
mainfrom
codex/gitcmd-windows-no-window

Conversation

@mariusvniekerk

Copy link
Copy Markdown
Contributor

Summary

Fixes #18.

  • Route git/cmd.Runner process creation through a shared helper.
  • On Windows, set CREATE_NO_WINDOW for git child processes so console-less callers do not get visible git.exe console windows.
  • Keep non-Windows command construction unchanged.
  • Normalize a couple of Windows path/test assumptions surfaced while validating the fix.

Root Cause

Runner.Command and Runner.Run constructed exec.CommandContext(ctx, git, ...) directly with no SysProcAttr. When a caller is launched as a console-less process on Windows, console-subsystem git.exe children allocate their own visible console windows unless CREATE_NO_WINDOW is set.

Validation

  • go test ./...
  • git diff --check
  • Manual detached-parent repro using actual go.kenn.io/kit/git/cmd.Runner calls confirmed the unpatched path created visible windows; patched path stayed quiet.

@roborev-ci

roborev-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown

roborev: Combined Review (b35651d)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (codex/default, done, 1m36s), codex_security (codex/security, done, 57s) | Total: 2m33s

@mariusvniekerk mariusvniekerk force-pushed the codex/gitcmd-windows-no-window branch from b35651d to 170d0d5 Compare June 12, 2026 02:42
@roborev-ci

roborev-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown

roborev: Combined Review (170d0d5)

Summary verdict: One Medium issue remains; no High or Critical findings were reported.

Medium

  • git/cmd/gitcmd.go:240: Internal safe.directory probes still construct git processes with exec.CommandContext directly, so default Runner.Run/Command can still spawn visible Windows console windows before the main git command.
    • Fix: Build these probe commands through gitCommand or call prepareGitCommand(cmd) before cmd.Output().

Panel: ci_default_security | Synthesis: codex, 6s | Members: codex_default (codex/default, done, 1m12s), codex_security (codex/security, done, 21s) | Total: 1m39s

The safe.directory config probes in readSafeDirectories still built their
git processes with exec.CommandContext directly, bypassing the
prepareGitCommand hook this branch adds. On Windows that meant the probe
processes could each flash a visible console window before the main git
command ran — the exact behavior the branch exists to suppress.

Flagged by roborev review of 170d0d5.

Validation: go build ./..., go test ./git/cmd, GOOS=windows go build ./git/..., go vet ./git/cmd

Generated with Claude Code (claude-fable-5)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@roborev-ci

roborev-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown

roborev: Combined Review (14e92d4)

No Medium, High, or Critical findings were reported.

The only finding was Low severity and is omitted per instructions.


Panel: ci_default_security | Synthesis: codex, 6s | Members: codex_default (codex/default, done, 1m47s), codex_security (codex/security, done, 33s) | Total: 2m26s

@mariusvniekerk mariusvniekerk marked this pull request as ready for review June 12, 2026 12:19
@mariusvniekerk mariusvniekerk merged commit 4f73c10 into main Jun 12, 2026
8 checks passed
@mariusvniekerk mariusvniekerk deleted the codex/gitcmd-windows-no-window branch June 12, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

git/cmd Runner spawns git without a hidden console — visible console-window flashing on Windows when called from a console-less process

1 participant