Skip to content

fix: add XDG fallback defaults to prevent permission errors - #2

Merged
paveg merged 1 commit into
mainfrom
fix/xdg-paths-permission-error
Dec 19, 2025
Merged

paveg merged 1 commit into
mainfrom
fix/xdg-paths-permission-error

Conversation

@paveg

@paveg paveg commented Dec 19, 2025

Copy link
Copy Markdown
Owner

Summary

  • Add XDG Base Directory fallback exports at top of .zshrc to handle cases where .zshenv is not sourced first
  • Disable ZDOTDIR in .zshenv to keep .zshrc at ~/.zshrc for simplicity

Problem

When .zshenv is not sourced before .zshrc, XDG variables would be empty, causing paths like ${XDG_CACHE_HOME}/devbox to resolve to just /devbox, resulting in permission denied errors:

mkdir: cannot create directory '/devbox': Permission denied
mkdir: cannot create directory '/zinit': Permission denied
mkdir: cannot create directory '/zsh': Permission denied

Test plan

  • Run chezmoi apply on a fresh system
  • Verify no permission errors on shell startup
  • Verify zinit, devbox, and starship initialize correctly

🤖 Generated with Claude Code

When .zshenv is not sourced before .zshrc (which can happen on some
systems), XDG variables would be empty, causing paths like
${XDG_CACHE_HOME}/devbox to resolve to /devbox, resulting in
permission denied errors.

Changes:
- Add XDG Base Directory fallback exports at top of .zshrc
- Disable ZDOTDIR in .zshenv to keep .zshrc at ~/.zshrc for simplicity

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@paveg
paveg merged commit a81d2b3 into main Dec 19, 2025
8 checks passed
@paveg
paveg deleted the fix/xdg-paths-permission-error branch December 19, 2025 06:14
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