Skip to content

fix: preserve taskkill flags under Git Bash#411

Open
Epochex wants to merge 1 commit into
openai:mainfrom
Epochex:fix/taskkill-msys-pathconv
Open

fix: preserve taskkill flags under Git Bash#411
Epochex wants to merge 1 commit into
openai:mainfrom
Epochex:fix/taskkill-msys-pathconv

Conversation

@Epochex

@Epochex Epochex commented Jun 30, 2026

Copy link
Copy Markdown

Summary

  • scope MSYS path-conversion opt-out to the Windows taskkill process-tree cleanup call
  • preserve /PID, /T, and /F when Claude Code is launched from Git Bash/MSYS
  • cover the Windows helper path with a regression assertion for the child env

Addresses #331. Related to #409.

Tests

  • node --test tests\process.test.mjs
  • git diff --check

Not run: full npm.cmd test timed out locally on Windows while runtime broker fixtures kept running; this change is covered by the focused process helper test.

@Epochex Epochex requested a review from a team June 30, 2026 18:57

@rajpratham1 rajpratham1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a focused, low-risk fix for a real Windows/MSYS compatibility issue.

Why it looks correct
It introduces:
envWithoutMsysPathConversion()

which sets:

MSYS_NO_PATHCONV=1
MSYS2_ARG_CONV_EXCL=*

These are the standard environment variables used to disable Git Bash/MSYS argument rewriting.

Previously:
taskkill /PID 1234 /T /F

could be rewritten by Git Bash, causing /PID and /T to be interpreted as paths instead of switches.

Now only the taskkill invocation receives the modified environment:
env: envWithoutMsysPathConversion(options.env)

so the change is isolated and doesn't affect other commands.

Test quality

The updated test verifies:

Windows platform
Git Bash (SHELL=...bash.exe)
existing environment variables are preserved
MSYS_NO_PATHCONV
MSYS2_ARG_CONV_EXCL
correct taskkill arguments

This is exactly the regression that needed coverage.

Risk

Very low.

The environment override applies only to the Windows taskkill execution and preserves the caller's existing environment.

Minor suggestion

envWithoutMsysPathConversion() could avoid recreating the environment if the variables are already set, but this is purely an optimization.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants