Fix Ghostty Settings config file selection
Closed
PH
7mo ago+608+608+012345678901234567890123456789-102-102-012345678901234567890123456789
Summary
- Replaced the single-path
ghostty_config_open_path()behavior behindGhostty Settings…with cmux-side resolution that walks the expected top-level Ghostty config load order and opens all
existing non-empty config files in TextEdit. - Added support for
XDG_CONFIG_HOMEso the settings action follows the same XDG root users expect when their Ghostty config is not under~/.config. - Preserved symlinked config entrypoints so users with dotfiles-managed Ghostty configs do not get redirected to a different fallback file.
Why:
Ghostty Settings…was opening the wrong file for users whose real config lived in XDG locations such as~/.config/ghostty/config.- In practice that meant the menu could open a nearly empty app-support config while the user’s actual active config lived elsewhere.
- This change makes the settings action open the config files users are actually editing in the standard load-order locations used by cmux.
Closes #1476
Testing
- Built and launched a tagged debug app with:
./scripts/reload.sh --tag issue-1476
- Added unit coverage for:
- load-order resolution
- fallback path selection
- empty-file filtering
- injected home-directory handling
- custom
XDG_CONFIG_HOME - symlinked config entrypoints
- Verified the tagged app build succeeds locally.
Manual verification:
- Verified the settings action behavior against the original issue scenario by checking that XDG-path config resolution is used instead of only opening the app-support Ghostty config path.
Note:
- I did not complete a full local unit-test run because the local SwiftPM test invocation hit a pre-existing binary artifact cache issue unrelated to this patch. The tagged app build completed
successfully.
Demo Video
- Video URL or attachment: N/A
Review Trigger (Copy/Paste as PR comment)
@codex review
@coderabbitai review
@greptile-apps review
@cubic-dev-ai review
Checklist
- tested the change locally
- I added or updated tests for behavior changes
- I updated docs/changelog if needed
- I requested bot reviews after my latest commit (copy/paste block above or equivalent)
- All code review bot comments are resolved
- All human review comments are resolved
Summary by CodeRabbit
-
New Features
- Improved editor config discovery across XDG, home, and Application Support with canonical-path resolution, symlink handling, and deduplication.
- Opens all discovered config files at once and auto-creates parent directories/files when editing a single, non-existent config.
- More reliable disk loading that respects environment and bundle resource contexts and avoids reloading duplicate paths.
-
Tests
- Added extensive tests for resolution order, symlink handling, deduplication, empty-file ignoring, and fallback behavior.