fix(init): wire statusline with absolute node path, not bare node (#181) - #203
Merged
Conversation
init wired the status line with a bare `node "<script>"`. Claude Code spawns the status-line command in a process that may not have `node` on PATH (e.g. node at %LOCALAPPDATA%\node22\current); the command then dies with exit 127 and the bar renders silently blank with no error surfaced. Use process.execPath — the absolute path of the node currently running init — quoted alongside the script path so both tolerate spaces. Re-init idempotently overwrites the statusLine.command key, so a stale bare-`node` wiring is healed on the next `init --statusline`. Closes #181 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2 tasks
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.
Closes #181
Problem
init.mjswired the Claude Code status line with a barenode "<script>". Claude Code spawns the status-line command in a process that may not havenodeon PATH (e.g. node installed to%LOCALAPPDATA%\node22\current\node.exe, as on the maintainer's machine 2026-07-22). The command then dies with exit 127 and — because the status line fails silent by design — the bar renders completely blank with no error surfaced. Worse, re-running init rewrote the same bare-nodecommand, so the documented/forge:statusline"re-init" remediation was a no-op for this failure mode.Fix
At init time, wire the absolute node binary via
process.execPath(the node currently running init — portable and absolute), quoted alongside the script path so both tolerate spaces:mergeJson/deepMergeoverwrites thestatusLine.commandstring leaf on each run, so a stale bare-nodewiring is healed on the nextinit --statusline.Acceptance criteria
process.execPath) intosettings.local.jsonstatusLine.command, quoted to tolerate spaces.nodeis absent from the spawning process's PATH. (Behavioural guarantee; unit-verified via the absolute-path + quoting assertions in AC-4 — a PATH-stripped Claude status-line process can't be spawned in a unit test. The command no longer depends on PATH at all: it names the node binary by absolute path.)nodewirings are healed on the nextinit --statusline(idempotent overwrite of thestatusLinekey viamergeJson; new test seeds a stale bare-nodecommand and asserts it is replaced while unrelated keys survive).process.execPathinterpolation + quoting (tests/init.test.mjs, two new#181tests).Verification
pnpm verify(=vitest run): 373/373 pass locally, including 2 new#181tests.forge:reviewer(full branch): pass, zero findings.forge:security(full branch): pass, zero findings. No new injection surface — both interpolated values are runtime-derived (Node's own binary path, the plugin's own installed file path); written as an encoded JSON string via atomicwriteJson;settings.local.jsonis gitignored so the machine-specific path never lands in a committed file.Follow-up
Filed #202 (child of epic #182) to revisit the
/forge:statusline§1/§2 "re-init" remediation text — re-init is now a real fix rather than a no-op (out of scope for #181 per its Notes).🤖 Generated with Claude Code