Skip to content

Load configuration from XDG system config#12945

Closed
mjrochford wants to merge 6 commits into
ghostty-org:mainfrom
mjrochford:xdg-system-config
Closed

Load configuration from XDG system config#12945
mjrochford wants to merge 6 commits into
ghostty-org:mainfrom
mjrochford:xdg-system-config

Conversation

@mjrochford

Copy link
Copy Markdown
Contributor

Fixes: #4506
Builds on: #4584
This PR is a continuation of #4845, It adds internal_os.xdg.Dir which allows using XDG_CONFIG_DIRS
to load system and user config files from XDG standard paths. I believe I have addressed the issues
raised in the previous PRs; Garbled directory was caused by a use after free to me misunderstanding
that defer is block scoped not function scoped.
The configs are applied in reverse order from last to first, followed by the User config file which has highest precedence.

Thanks to jcollie for starting on this issue.

Windows support is out of scope for this PR.

AI Disclaimer:
I used Claude as a pair programmer for code review and to catch bugs during development.
The design, implementation, and final code are my own.

See also:

@mjrochford mjrochford requested a review from a team as a code owner June 6, 2026 23:12
@ghostty-vouch

ghostty-vouch Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Hi @mjrochford, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/ghostty-org/ghostty/blob/main/CONTRIBUTING.md for more details.

@ghostty-vouch ghostty-vouch Bot closed this Jun 6, 2026
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.

Load configuration from XDG_CONFIG_DIRS

2 participants