Repository navigation
Conversation
Claude Code cancels an in-flight status line when a new update arrives. On Windows, a parent killed while creating a child leaves that child suspended forever, so git.exe processes pile up. Run the script in a kill-on-close job object so Windows terminates its children with it, and pass --no-optional-locks so a killed git cannot leave a stale index.lock. Fixes daniel3303#60 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GXnnyDw7DGcUjXnZRuXNKL
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.
Fixes #60
Change
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, so Windows terminates its children when it dies, including a child still suspended. It usesReflection.Emitrather thanAdd-Type, becauseAdd-Typecompiles withcsc.exeand would add another child process and a noticeable delay.--no-optional-locks, so a git process killed mid-run cannot leave a staleindex.lockbehind.If the job cannot be created, the script carries on as before.
Testing
On Windows 11, Windows PowerShell 5.1, git 2.55.0.windows.5:
In real use with about 9 Claude Code sessions open, no status line git process was left suspended in 4 hours 20 minutes. The rate before the fix was about 16 per hour.
Not tested: PowerShell 7 (not installed on my machine).
statusline.shis unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01GXnnyDw7DGcUjXnZRuXNKL