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
- Open a Git-backed project in Sync on Windows.
- Use a project with changed files and, preferably, one or more worktrees.
- Click Review in the main view switcher.
- 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.
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.execommands. These non-interactive child processes are not launched withCREATE_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
PATHSteps to reproduce
Actual behavior
Opening Review creates a burst of visible
git.execonsole 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:
useReviewQueue)useBranchReview)useGitDiff)See
ReviewPage.tsx.The backend documents that the queue performs a fork-point diff plus
git statusper worktree:ipc.rs.queue_rowsthen 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:
review.rsworking_tree_statusruns separate commands for branch, upstream divergence, dirty state, and remotes:git.rsgit difffor each changed file:git.rsgit diff --no-index:git.rsThe 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 therun,run_ok_raw, andrun_capturepaths.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.