fix: chain the statusline badge instead of taking the whole slot - #910
Open
xanderscannell wants to merge 1 commit into
Open
xanderscannell wants to merge 1 commit into
xanderscannell wants to merge 1 commit into
Conversation
Claude Code has one statusLine slot, and the setup nudge treated it as
all-or-nothing. With a statusLine already configured, activate.js set
hasStatusline and stayed silent for good, so anyone running a custom
status line (or another plugin's) never got the badge at all. With none,
the nudge claimed the slot outright, which leaves a blank row whenever
ponytail goes quiet.
Chain into it instead. The badge already prints without a trailing
newline, so running it ahead of the existing command renders both on one
row, and an inactive ponytail exits 0 with no output, leaving that
command's line untouched. Separator is ';' rather than '&&': Claude Code
runs the status line through Git Bash when installed and PowerShell when
not, and Windows PowerShell 5.1 cannot parse '&&'.
- hooks/ponytail-activate.js: read the command already in the slot and
chain it after ours; stay quiet when ponytail is already in the chain,
or when the statusLine is not a string command. The snippet is rebuilt
from the existing block, so sibling keys (padding, refreshInterval)
survive instead of being dropped by the paste
- hooks/ponytail-statusline.{sh,ps1}: trailing space after the color
reset, so the badge does not butt against the next command's output
- tests/hooks.test.js: an existing status line gets the nudge and comes
back out of the snippet intact; ponytail already in the chain is not
offered again
scripts/uninstall.js needs no change: it already splits on ';' and keeps
non-ponytail segments (DietrichGebert#374), and a single remaining segment rejoins
without a separator, so unchaining round-trips exactly.
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.
Problem
Claude Code has a single
statusLineslot, and the setup nudge inponytail-activate.jstreats it as all-or-nothing:statusLineis already configured →hasStatusline = trueand ponytail stays silent forever. Anyone running a custom status line, or another plugin's, never gets the badge at all and is never told why.statusLine→ the nudge claims the slot outright. That's fine while ponytail is active, but the script exits silently when the mode flag is absent, so turning ponytail off leaves an empty row rather than the line you had.The repo already assumes chained status lines exist —
scripts/uninstall.jssplits on&&/;and preserves non-ponytail segments (#374) — but nothing on the install path ever produces one.Fix
Chain into the slot instead of taking it. The badge already prints without a trailing newline, so running it ahead of the existing command renders both on one row, and an inactive ponytail exits 0 with no output, leaving the rest of the line untouched.
;rather than&&as the separator: Claude Code runs the status line through Git Bash when Git Bash is installed and PowerShell when it isn't, and Windows PowerShell 5.1 cannot parse&&(verified on 5.1.26100).;parses in Git Bash, PowerShell 5.1 and PowerShell 7.The snippet is rebuilt from the existing
statusLineblock, so sibling keys such aspaddingandrefreshIntervalsurvive rather than being dropped when the suggested JSON is pasted in.Ponytail stays quiet when it is already in the chain, or when
statusLine.commandis not a string (nothing safe to chain onto).scripts/uninstall.jsneeds no change: splittingponytail ; baseleaves a single remaining segment, which rejoins with no separator, so unchaining round-trips to the original command exactly. Verified below.Result
One row in every case. The third line is the behaviour this fixes — today that row is blank.
Verification
node scripts/check-rule-copies.jsandnode scripts/check-versions.jspass.npm testpasses 94/95; the one failure,csv: correct pandas one-liner passes, fails identically on unmodifiedmainin my environment and is untouched by this change.tests/hooks.test.jsfail against the currentponytail-activate.jsand pass with the change.statusLine: the nudge fired, Claude applied the chained command, the badge rendered inline on one row, and toggling ponytail off left the status line intact.;-chained command throughnode scripts/uninstall.jsand confirmedstatusLine.commandcame back byte-for-byte as the original.Notes
check-versions.jspins 8 files and releases look like separatechore: releasecommits.getHideStatus()is honoured bypi-extension/index.jsbut not by the Claude Code statusline scripts, soPONYTAIL_HIDE_STATUSsilently does nothing there. Happy to open an issue if that's worth fixing.