Skip to content

Windows: opening Review flashes many Git console windows #5

Description

@kapustazh

Summary

On Windows, clicking Review can cause a large burst of console/terminal windows to open and immediately close.

The number of flashes grows with the number of worktrees and changed files. Review mounts several data queries at once, and their backend implementations run many individual git.exe commands. These non-interactive child processes are not launched with CREATE_NO_WINDOW.

This is related to #4, but it is a separate trigger and code path: #4 covers CLI integration probes when opening Settings; this issue covers the Git command fan-out when opening Review.

Environment

  • OS: Windows 11 x64, 25H2 (build 26200.8875)
  • Sync: Windows x64 build installed with the official setup executable
  • Git for Windows is installed and available on PATH

Steps to reproduce

  1. Open a Git-backed project in Sync on Windows.
  2. Use a project with changed files and, preferably, one or more worktrees.
  3. Click Review in the main view switcher.
  4. Observe many console windows appear and disappear in rapid succession.

Actual behavior

Opening Review creates a burst of visible git.exe console windows. This is very disruptive and makes the desktop UI look as if it is launching unrelated terminals.

Expected behavior

All read-only Git queries used to render Review should run silently in the background. No OS console windows should appear.

Source analysis

Opening Review mounts three data paths together:

  • the review queue (useReviewQueue)
  • the current branch review (useBranchReview)
  • the full Git diff (useGitDiff)

See ReviewPage.tsx.

The backend documents that the queue performs a fork-point diff plus git status per worktree: ipc.rs. queue_rows then calls status/diff helpers for the main checkout and every linked worktree: ipc.rs.

The full diff path also fans out into additional Git processes:

  • resolving the review border uses multiple Git reads: review.rs
  • working_tree_status runs separate commands for branch, upstream divergence, dirty state, and remotes: git.rs
  • diff rendering runs a name/status query and then a separate git diff for each changed file: git.rs
  • untracked files can each trigger another git diff --no-index: git.rs

The shared Git helpers use plain std::process::Command::new("git").output() with no Windows creation flags: git.rs, git.rs.

This explains why a single click can produce many flashes rather than one: the process count is roughly proportional to the number of worktrees and changed files.

Suggested fix

Centralize construction of non-interactive Git commands and apply std::os::windows::process::CommandExt::creation_flags(CREATE_NO_WINDOW) on Windows. All background Git reads should use that helper, including the run, run_ok_raw, and run_capture paths.

Interactive agent processes launched through the embedded PTY should remain unchanged.

Add a Windows smoke test for opening Review on a repository with several changed files/worktrees and verify that no visible console windows are created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions