Skip to content

fix(doctor): remove window-save-state recommendation#183

Merged
juan294 merged 1 commit intodevelopfrom
worktree-remove-window-save-state
Mar 17, 2026
Merged

fix(doctor): remove window-save-state recommendation#183
juan294 merged 1 commit intodevelopfrom
worktree-remove-window-save-state

Conversation

@juan294
Copy link
Owner

@juan294 juan294 commented Mar 17, 2026

Summary

  • Remove window-save-state = always from summon doctor checks and --fix auto-configuration
  • Ghostty's window-save-state restores split layouts but not pane commands, creating stale splits that conflict with summon's own layout management on re-launch

Test plan

  • All 955 tests pass
  • Typecheck and lint clean
  • Doctor now checks 2 settings (notify-on-command-finish, shell-integration) instead of 3
  • --fix adds 2 settings when none present, 1 when one already exists

🤖 Generated with Claude Code

Ghostty's window-save-state restores split layouts but not pane
commands, creating stale splits that conflict with summon's own
layout management on re-launch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@juan294 juan294 merged commit 59d80e9 into develop Mar 17, 2026
5 of 6 checks passed
@juan294 juan294 deleted the worktree-remove-window-save-state branch March 17, 2026 07:12
juan294 added a commit that referenced this pull request Mar 17, 2026
* feat(setup): detect macOS accessibility permissions and guide first-time users

Summon uses System Events (for auto-resize and new-window) which requires
the terminal app to have Accessibility permission. Previously, first-time
users hit a cryptic -1719 error after completing the wizard, with guidance
pointing to the wrong settings pane.

- Add checkAccessibility() probe and openAccessibilitySettings() opener
- Add isAccessibilityError() helper and shared guidance constants
- Setup wizard: check after tool validation, offer to open Settings, re-check
- Doctor: add "Checking permissions" section with accessibility status
- Launcher: differentiate -1719 from generic osascript errors with targeted
  messages pointing to the correct Accessibility pane

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: implement v1.2.0 features — theme, doctor --fix, per-pane cwd, freeze, keybindings (#104, #113, #114, #115, #116, #117)

Phase 1: Ghostty theme per workspace (#104)
- Add theme: string | null across full pipeline (LayoutOptions → LayoutPlan → AppleScript)
- --theme CLI flag, config key, shell completions
- AppleScript: set theme of cfg to "..." with proper escaping

Phase 2: Doctor --fix (#113, #116)
- summon doctor --fix auto-adds missing recommended Ghostty settings
- Backs up config with timestamp before modifying
- Three settings: window-save-state, notify-on-command-finish, shell-integration

Phase 3: Per-pane working directories (#115)
- pane.<name>.cwd config keys for tree layouts
- Relative cwds resolved against targetDir
- extractPaneCwds() parser, threaded through resolveTreeCommands → script generation

Phase 4: summon freeze (#114)
- summon freeze <name> snapshots current resolved config as reusable custom layout
- Validates name, rejects duplicates, saves all config keys

Phase 5: Key table export (#117)
- summon keybindings generates Ghostty key table config for pane navigation
- --vim flag for hjkl instead of arrow keys
- New keybindings.ts pure function module

930 tests passing, typecheck/lint/build clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: extract helpers for config serialization, dry-run headers, and regex constants

- Extract optsToConfigMap() in launcher.ts — freeze uses it instead of 15 lines of manual field mapping
- Extract appendDryRunExtras() in launcher.ts — both dry-run blocks share starship/theme header logic
- Compile PANE_CWD_RE as a module-level constant in tree.ts
- Replace double-spread with Map constructor + set() loop in paneCwds merge

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: setup.test.ts test infrastructure (#176)

Add explicit throw in waitForHandler() if keypress handler is never
registered within timeout. Add documentation comments explaining why
setTimeout(0) is used to defer keypress simulation to the next tick.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: package.json metadata + deps (#181)

- Add "main" field for legacy tooling compatibility
- Add "publishConfig" with public access
- Update typescript-eslint from 8.56.1 to 8.57.1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: completions.ts subcommand-specific flags (#178)

Add doctor --fix and keybindings --vim flag completions for both zsh
and bash shell completion generators.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: config.ts path traversal hardening (#179)

Add defense-in-depth layoutPath() helper that verifies resolved paths
stay within LAYOUTS_DIR. Used in saveCustomLayout, readCustomLayout,
deleteCustomLayout, and isCustomLayout instead of bare join().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: coverage gaps in script and tree (#180)

Add test for 4+ editor panes with secondaryEditor exercising the
rightColumnEditorCount > 1 && secondaryCmd branch in script.ts.

Add dedicated test for advance() hitting end-of-input on truncated
tree DSL expressions ("a |" and "a /") in tree.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: index.ts UX fixes (#177)

- W4: validate env var key format in `summon set env.<KEY>`
- R17: freeze usage consistency (`<name>` not `<layout-name>`)
- R18: btop preset description (remove "lazygit" from description)
- R19: layoutNotFoundOrExit adds "Error:" prefix
- R20: doctor exits code 2 when issues remain unfixed
- R21: export includes env.* keys from config
- R24: config unknown key hint shows removal command
- R25: export adds ISO timestamp comment

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: launcher/utils/setup refactors (#175)

- Add unit tests for optsToConfigMap() covering all fields, empty opts,
  null fontSize/theme exclusion, and boolean flag filtering
- Remove trivial resolveCommand wrapper in launcher.ts; callers now use
  resolveCommandPath from utils.ts directly
- Extract isGhosttyInstalled() to utils.ts to deduplicate the
  GHOSTTY_PATHS.some(existsSync) pattern from launcher.ts and setup.ts
- Change promptUser Ctrl+C exit code from 0 to 130 (128 + SIGINT)
- Change nested workspace warning from "too scary" to "messy"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: update pre-launch audit report for v1.2.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(doctor): remove window-save-state recommendation (#183)

Ghostty's window-save-state restores split layouts but not pane
commands, creating stale splits that conflict with summon's own
layout management on re-launch.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove broken --theme flag — Ghostty AppleScript API does not support per-surface themes

Ghostty's surface configuration object only supports: initial working
directory, font size, command, environment variables, wait after command.
The `theme` property does not exist (error -10006 at runtime).

Removed from: layout.ts, tree.ts, script.ts, launcher.ts, index.ts,
config.ts, completions.ts, and all associated tests and documentation.

Users should set themes globally in ~/.config/ghostty/config instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: add @internal JSDoc tags + cache listStarshipPresets (#186)

- Add @internal tags to test-only exports: GHOSTTY_PATHS (utils.ts),
  layoutPath (config.ts)
- Cache listStarshipPresets() results in a module-level variable,
  matching the existing cachedStarshipPath pattern
- Reset preset cache in resetStarshipCache() alongside path cache
- Add tests verifying cache hit, cache reset, and re-fetch behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: extract ENV_KEY_RE to shared constant + show config defaults (#184)

- Move ENV_KEY_RE regex from launcher.ts to validation.ts as shared export
- Import shared constant in index.ts and launcher.ts (remove duplicates)
- Show effective defaults in `summon config` when no machine config is set
- Add ENV_KEY_RE test coverage in validation.test.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: strengthen assertions + cover tree+CWD merge path (#185)

Replace 8 weak .toBeTruthy() assertions with .toBeTypeOf('string') in
setup.test.ts catalog/layout tests. Add 4 tests in launcher.test.ts
covering the tree layout + project CWD merge code path (launcher.ts:442-450).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* release: v1.2.1 — remove broken theme flag, doctor fixes, code quality

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant