fix: skip ps.exe on Windows to prevent console window popups - #43933
Closed
bighamx wants to merge 1 commit into
Closed
fix: skip ps.exe on Windows to prevent console window popups#43933bighamx wants to merge 1 commit into
bighamx wants to merge 1 commit into
Conversation
On Windows, Git ships ps.exe at C:\Program Files\Git\usr\bin\ps.exe. The gateway's _read_process_cmdline() called subprocess.run(['ps', ...]) which found Git's ps.exe and spawned a visible console window each time the gateway checked a process status. Fix: on win32, skip the ps call entirely and use psutil directly (which is already a dependency). Non-Windows platforms are unchanged.
tonydwb
approved these changes
Jun 11, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Fix: Skip ps.exe on Windows to prevent console window popups
- Problem: On Windows, running
ps -p <pid> -o command=invokes Git's bundledps.exewhich pops a visible console window, disrupting the user experience. - Fix: On Windows (
sys.platform == "win32"), skip thepssubprocess and usepsutildirectly. On other platforms, use the existingpssubprocess path. - Clean, simple fix with no test changes needed (behavioral difference only observable on Windows GUI).
Reviewed by Hermes Agent
This was referenced Jun 29, 2026
Open
2 tasks
Contributor
|
Thanks for the Windows report and focused fix. This is already implemented on current
Closing as implemented on main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows with Git installed,
gateway/status.py's_read_process_cmdline()callssubprocess.run(["ps", "-p", ...])which finds Git'sC:\Program Files\Git\usr\bin\ps.exein PATH. Each call spawns a visible console window that flashes on screen.The gateway checks process status periodically, so users see intermittent ps.exe console window popups as long as the gateway is running.
Root Cause
The function tries
/proc/<pid>/cmdlinefirst (fails on Windows), then falls through to thepscommand — which resolves to Git's ps.exe on Windows. The psutil fallback sits after thepscall and is never reached.Fix
On
win32, skip thepssubprocess call entirely and use psutil directly (already a dependency). Non-Windows platforms are unchanged.Testing