fix: preserve user's custom statusLine config (#39)#43
Merged
Conversation
DeckardHooksInstaller now checks for an existing non-Deckard statusLine in settings.json and saves it to ~/.deckard/original-statusline.json before installing its own. The mergeHooksIntoSettings method is refactored to accept injectable paths for testability.
The statusline.sh wrapper now reads stdin once, sends quota data to Deckard via socket, then delegates to the user's original statusline command (read from ~/.deckard/original-statusline.json). If no original exists or Deckard isn't running, each part degrades silently.
DeckardHooksInstaller.uninstall() restores the user's original statusLine from ~/.deckard/original-statusline.json, removes all Deckard hook entries (preserving non-Deckard hooks), and cleans up the hooks directory.
Verifies the full install → re-install → uninstall cycle with a realistic cc-statusline config (relative path + padding field). Ensures all original fields are preserved and restored 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.
Summary
statusLineconfig (e.g. cc-statusline) to~/.deckard/original-statusline.jsonbefore overwriting it with Deckard's own scriptstatusline.shto chain both: quota data flows to Deckard via socket, then the original statusline command runs with the same stdinuninstall()method that restores the originalstatusLineand removes all Deckard hooks fromsettings.jsonTest plan
paddingfield)original-statusline.jsoncreatedCloses #39
🤖 Generated with Claude Code