Skip to content

feat: expand tildes in config theme path to HOME - #13840

Merged
jcollie merged 4 commits into
ghostty-org:mainfrom
preiter93:pr/expand-tildes-in-config-theme
Aug 16, 2026
Merged

jcollie merged 4 commits into
ghostty-org:mainfrom
preiter93:pr/expand-tildes-in-config-theme

Conversation

@preiter93

Copy link
Copy Markdown
Contributor

When loading a theme from a path that includes a tilde:

theme="~/.cache/wal/colors-ghostty"

ghostty currently fails with the following error:

cannot include path separators unless it is an absolute path

This PR tries to expand the ~ of the path. If there is no ~ or expansion fails, it falls back to the unexpanded value.

When loading a theme from a path that includes a tilde:
```
theme="~/.cache/wal/colors-ghostty"
```
currently fails with the following error:
```
cannot include path separators unless it is an absolute path
```

This PR tries to expand the ~ of the path. If there is no ~
or expansion fails, it falls back to the unexpanded value.
@ghostty-vouch

ghostty-vouch Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Hi @preiter93, 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 Aug 15, 2026
@jcollie jcollie reopened this Aug 15, 2026

@jcollie jcollie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tilde expansion should happen when the config is parsed, not when the theme is loaded.

Comment thread src/config/theme.zig Outdated
@preiter93
preiter93 force-pushed the pr/expand-tildes-in-config-theme branch from 5c24607 to b5dc6e9 Compare August 15, 2026 18:08
@preiter93
preiter93 force-pushed the pr/expand-tildes-in-config-theme branch from b5dc6e9 to c121734 Compare August 15, 2026 18:10
Comment thread src/config/Config.zig Outdated
@preiter93
preiter93 requested a review from jcollie August 16, 2026 08:39
@jcollie

jcollie commented Aug 16, 2026

Copy link
Copy Markdown
Member

This is looking good, just need to fix up the formatting to please zig fmt.

@preiter93

Copy link
Copy Markdown
Contributor Author

done, feel free to merge when it goes through ci :)

@jcollie
jcollie merged commit 7557944 into ghostty-org:main Aug 16, 2026
101 checks passed
@github-actions github-actions Bot added this to the 1.4.0 milestone Aug 16, 2026
@preiter93
preiter93 deleted the pr/expand-tildes-in-config-theme branch August 22, 2026 06:59
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.

2 participants