Skip to content

fix: preserve user's custom statusLine config (#39)#43

Merged
gi11es merged 4 commits intomasterfrom
fix/statusline-preservation
Mar 28, 2026
Merged

fix: preserve user's custom statusLine config (#39)#43
gi11es merged 4 commits intomasterfrom
fix/statusline-preservation

Conversation

@gi11es
Copy link
Copy Markdown
Owner

@gi11es gi11es commented Mar 28, 2026

Summary

  • Save the user's existing statusLine config (e.g. cc-statusline) to ~/.deckard/original-statusline.json before overwriting it with Deckard's own script
  • Update the wrapper statusline.sh to chain both: quota data flows to Deckard via socket, then the original statusline command runs with the same stdin
  • Add uninstall() method that restores the original statusLine and removes all Deckard hooks from settings.json

Test plan

  • 189 unit tests pass (7 new tests for this feature)
  • Round-trip test with realistic cc-statusline config (relative path + padding field)
  • Verified: original saved on first install, not overwritten on re-install, fully restored on uninstall
  • Manual: launch with fake custom statusLine, verify original-statusline.json created
  • Manual: verify quota display still works in sidebar

Closes #39

🤖 Generated with Claude Code

gi11es added 4 commits March 28, 2026 19:10
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.
@gi11es gi11es merged commit 2a48e5b into master Mar 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deckard overwrites custom statusline (CWD, branch info lost)

1 participant