gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Add background process tracking support for Windows in shell tool

Open akhil29 opened this issue 4 months ago • 1 comments

Description

The current implementation of background process tracking in the shell tool has limited support for Windows. While Unix-like systems can track background processes using pgrep and process groups, Windows doesn't have equivalent functionality implemented.

Current Behavior

On Unix/Linux/macOS:

  • Background processes are tracked via a temp file using pgrep
  • Process groups are used to terminate all child processes
  • SIGTERM followed by SIGKILL ensures proper cleanup

On Windows:

  • Background process PIDs are not tracked (pgrep not available)
  • Only the main process can be terminated with taskkill
  • Child processes may become orphaned

Proposed Solution

Implement Windows-specific background process tracking:

  1. Use Windows Job Objects or WMI to track child processes
  2. Implement a Windows-equivalent of the pgrep functionality
  3. Ensure all child processes are terminated when cancellation occurs

Related PR

This issue was identified during the implementation of #7790 which adds cancellation support for slash commands and background processes.

Acceptance Criteria

  • [ ] Background processes launched with & are tracked on Windows
  • [ ] All child processes are terminated when the parent is cancelled
  • [ ] Tests verify Windows-specific functionality
  • [ ] Cross-platform behavior is consistent

akhil29 avatar Oct 12 '25 06:10 akhil29

This issue has been automatically marked as stale due to 60 days of inactivity. It will be closed in 14 days if no further activity occurs.

github-actions[bot] avatar Dec 12 '25 02:12 github-actions[bot]

Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.

It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.

Thank you for your contribution!

gemini-cli[bot] avatar Jan 18 '26 00:01 gemini-cli[bot]