perf(starship): pin explicit command_timeout so wedged git modules get reaped#126
Conversation
…t reaped Pin command_timeout = 1300 (was the implicit 500ms default). It is both a correctness knob (a git status on a large/cold repo can exceed 500ms and blank the git segment) and, more importantly, the safety valve: command_timeout is the bound at which starship abandons AND kills the external command backing a segment (git_* modules, [custom] commands). When a git call wedges — stale index.lock, a repo on a slow \\wsl$/network path, a hung credential probe — the child is now reaped at this bound instead of left running. On Windows an un-reaped git child orphans, and one-per-prompt-render piles up into hundreds of stuck git.exe (enough that scoop/winget can't replace the in-use git binary to update it). Pairs with a Windows-side pwsh change that makes shell-spawned git fail fast rather than block on an auth prompt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xz3QgaavdDKmbtLcQStnDE
There was a problem hiding this comment.
Pull request overview
This PR pins an explicit command_timeout = 1300 (ms) in the vendored starship/starship.toml, replacing reliance on starship's implicit 500ms default. The value serves two purposes: allowing git status on large/cold repos to finish rendering (correctness), and acting as a bound at which starship abandons and kills a wedged external git child (reaping), which is especially important on Windows where un-reaped git.exe children can accumulate. The change is recorded under [Unreleased] in CHANGELOG.md and pairs with a companion Windows-side pwsh change in the dotfiles-Windows repo.
Changes:
- Set
command_timeout = 1300at the top ofstarship/starship.toml, with a detailed rationale comment. - Add a
### Changedentry documenting the timeout pin under[Unreleased]inCHANGELOG.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| starship/starship.toml | Adds explicit command_timeout = 1300 top-level key with an explanatory comment covering correctness and child-reaping rationale. |
| CHANGELOG.md | Records the timeout pin as a ### Changed bullet under [Unreleased]. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What
Pin an explicit
command_timeout = 1300instarship/starship.toml(previously the implicit 500ms default), and record it under[Unreleased]inCHANGELOG.md.Why
command_timeoutis the ceiling starship waits for any external command it runs to render a segment — thegit_*modules (git_status/branch/commit/state) and any[custom]command — before it abandons the call and kills the child. Two reasons to pin it:git statuson a large or cold repo can legitimately take >500ms, and the default blanks the git segment mid-render. 1300ms clears that on real repos without feeling laggy..git/index.lock, a repo on a slow\\wsl$/network path, a hung credential probe — starship stops waiting and terminates the child at this bound instead of leaving it running. On Windows especially, an un-reaped git child orphans, and one per prompt render piles up into hundreds of stuckgit.exe— enough that scoop/winget then can't replace the in-use git binary to update it.Related
Pairs with a Windows-side pwsh change (dotfiles-Windows, same branch) that makes shell-spawned git fail fast rather than block on an auth prompt, and mirrors this
command_timeoutinto the vendoredstarship.tomlthere.Testing
make audit-changed— pass 229 / fail 0 (luacheck + markdownlint skipped: not installed in this environment).🤖 Generated with Claude Code
Generated by Claude Code