Repository navigation
Commit 475e401
fix(install): keep unreadable Claude settings instead of overwriting them (#627)
installStatusLine caught any error from loadClaudeSettings (a JSON parse
failure such as a trailing comma, EACCES/EBUSY, or a read racing Claude
Code's own write), printed a warning, fell back to {} and then saved a
settings.json containing only statusLine. Permissions, hooks, env, model
and every other key were lost: the .bak written by saveClaudeSettings is
immediately overwritten by the widget-hook sync, and the .orig backup is
overwritten by the next install.
loadClaudeSettings already returns {} when the file does not exist, so
any error it throws means the file exists but cannot be read or parsed.
In that case install now aborts with an error naming the file and the
reason, leaving it (and any previous .orig) untouched; the .orig backup
is taken only after a successful read. This matches uninstallStatusLine,
which already refuses to modify unreadable settings. The TUI shows the
error text in an "Install Failed" notice instead of a 2-second flash.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent baf37e1 commit 475e401
3 files changed
Lines changed: 23 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
717 | 717 | | |
718 | 718 | | |
719 | 719 | | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
724 | 727 | | |
725 | | - | |
| 728 | + | |
726 | 729 | | |
727 | 730 | | |
728 | 731 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
| 521 | + | |
522 | 522 | | |
523 | | - | |
524 | | - | |
525 | | - | |
| 523 | + | |
526 | 524 | | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
| 525 | + | |
| 526 | + | |
533 | 527 | | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
540 | 531 | | |
541 | 532 | | |
542 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
409 | 411 | | |
410 | 412 | | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
415 | 416 | | |
416 | 417 | | |
| 418 | + | |
| 419 | + | |
417 | 420 | | |
418 | 421 | | |
419 | 422 | | |
| |||
0 commit comments