Skip to content

[Bug]: Every git read on Windows starts a hidden conhost.exe #28901

Closed

Description

@AkiVonAkira

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. On Windows with Git for Windows installed, open a project in the desktop app.
  2. Watch process starts while the app is idle, for example with Process Monitor filtered to process create events, or a job object around the server.

Expected behavior

A git read such as git rev-parse --git-path index or git config --get <key> starts one process, git.exe.

Actual behavior

Every git command the server starts also starts a hidden conhost.exe. The desktop server is a GUI-subsystem process, so it has no console. Effect's spawner passes windowsHide: true, libuv turns that into CREATE_NO_WINDOW, and Windows then creates a new console host for each console program it starts.

On my machine each console host adds about 11 ms to git's startup. A remote status refresh runs 10 processes instead of 5 and takes about 127 ms instead of 64 ms at the median. Over 2 minutes with a project open and idle, a dev server started 126 processes, of which 73 were conhost.exe.

Git for Windows runs fine without a console. When it has none, it starts its own children with DETACHED_PROCESS (compat/mingw.c). So the server could start git's plain ref and config reads the same way.

This is the remaining part of #12498. When that issue was closed, the reply said idle process starts were still above target and asked for a new issue for that part.

Impact

Minor bug or occasional failure

Version or commit

main @ 01a93e7

Environment

Windows 11 Pro 23H2, Git for Windows 2.54.0 (mingw64) and MinGit 2.56.0.2 (ucrt64), T3 Code desktop (Electron's Node 24)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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