feat(config): editable ~/.config/termio/config file - #5
Open
jiweiyuan wants to merge 1 commit into
Open
Conversation
Make a Ghostty-style key=value config file the canonical settings store. The Settings window edits the common subset and writes back into the file; the file exposes the full scalar set for hand-editing, and termio watches it so an external edit applies live — no relaunch. - ConfigFile: XDG path, parser, and a surgical rewriter that updates keys in place while preserving comments, layout, and unmanaged keys - ConfigFileWatcher: directory-level vnode watch (survives atomic saves), debounced, hopping back to the main actor - AppSettings: adopt the file on launch (hand edits win over the UserDefaults cache), seed a self-documenting file on first run from existing prefs, and mirror GUI edits back debounced; an applying-guard plus a last-written content check prevent a write/watch/rewrite loop - Appearance settings: an "Open Config File…" button - termio CLI: `config path` and `config edit` subcommands Scope: scalar appearance/terminal/interface options plus the two agent toggles. Per-agent command overrides and app-state/consent are excluded.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 tasks
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.
What
Adds a canonical, editable
~/.config/termio/configfile (Ghostty-stylekey = value). The Settings GUI now edits the common subset and writes back into the file; the file exposes the full scalar set for hand-editing, and termio watches it so an external edit applies live — no relaunch.GUI and file are the same source of truth: the GUI is a curated window onto a superset the file exposes in full.
UserDefaultsis demoted to a cache + one-time migration source — existing prefs seed the file on first run, so nothing is lost.Changes
Config/ConfigFile.swift(new) — XDG path, parser, and a surgical rewriter that updates changed keys in place while preserving comments, layout, and keys termio doesn't manage. PlusConfigFileWatcher: a directory-level vnode watch (survives editors' atomic saves), debounced, hopping back to the main actor.Settings.swift—AppSettingsadopts the file on launch (hand edits win over theUserDefaultscache), seeds a self-documenting file on first run, and mirrors GUI edits back (debounced). AnisApplyingConfigguard + a last-written content check prevent a write→watch→rewrite loop.AppearanceSettingsTab.swift— an "Open Config File…" button + a Config File section.scripts/termio—termio config pathandtermio config editsubcommands.Scope
Scalar appearance / terminal / interface options plus the two agent toggles (18 keys). Per-agent command overrides deferred to a follow-up (repeated-key round-tripping); app-state/consent (recent projects, usage/keychain) excluded — not user config.
Verification
swift buildcleanthemelight/dark pair encoded + re-parsedconfig pathresolves correctly (dev-channel aware), shell syntax OK