Bug Description
install.sh hardcodes symlink destinations to $HOME/.zshrc but .zprofile sets ZDOTDIR=$HOME/.config/zsh (XDG Base Directory specification). This causes zsh to not find .zshrc on login, breaking starship prompt initialization.
Current Behavior
install.sh line 70:
link_file "$DOTFILES_DIR/.zshrc" "$HOME/.zshrc"
But .zprofile line 18 sets:
export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
Result: Zsh looks for .zshrc in ~/.config/zsh/ but install.sh creates it in ~/
Impact
- Starship prompt doesn't initialize on SSH login
- Users see plain
hostname% instead of colored starship prompt
- All zsh configurations fail to load
- Aliases, functions, and plugins not available
Expected Behavior
install.sh should respect ZDOTDIR environment variable and create symlinks in the correct location:
- If
ZDOTDIR is set → symlink to $ZDOTDIR/.zshrc
- If
ZDOTDIR is unset → symlink to $HOME/.zshrc (current behavior)
Proposed Fix
# Determine where zsh config should go
ZSH_CONFIG_DIR="${ZDOTDIR:-$HOME}"
# Create ZDOTDIR if it doesn't exist
if [ -n "$ZDOTDIR" ] && [ ! -d "$ZDOTDIR" ]; then
mkdir -p "$ZDOTDIR"
echo "[CREATE] Directory: $ZDOTDIR"
fi
# Link zshrc to correct location
link_file "$DOTFILES_DIR/.zshrc" "$ZSH_CONFIG_DIR/.zshrc"
Reproduction
- Source
.zprofile which sets ZDOTDIR=~/.config/zsh
- Run
install.sh
- SSH into system
- Observe: Plain prompt, no starship, no aliases
Environment
- OS: Ubuntu 22.04 LTS
- Shell: zsh 5.8.1
- Context: Discovered during vm-infra provisioning testing
Related
- XDG Base Directory Specification compliance
- Affects all users who set
ZDOTDIR in their environment
Workaround
Currently using workaround in vm-infra ansible playbook to create ~/.config/zsh/ and symlink .zshrc manually after dotfiles installation. Would prefer to fix root cause in dotfiles repo.
Labels
bug, xdg-compliance, zsh
Bug Description
install.shhardcodes symlink destinations to$HOME/.zshrcbut.zprofilesetsZDOTDIR=$HOME/.config/zsh(XDG Base Directory specification). This causes zsh to not find.zshrcon login, breaking starship prompt initialization.Current Behavior
install.sh line 70:
But .zprofile line 18 sets:
Result: Zsh looks for
.zshrcin~/.config/zsh/but install.sh creates it in~/Impact
hostname%instead of colored starship promptExpected Behavior
install.shshould respectZDOTDIRenvironment variable and create symlinks in the correct location:ZDOTDIRis set → symlink to$ZDOTDIR/.zshrcZDOTDIRis unset → symlink to$HOME/.zshrc(current behavior)Proposed Fix
Reproduction
.zprofilewhich setsZDOTDIR=~/.config/zshinstall.shEnvironment
Related
ZDOTDIRin their environmentWorkaround
Currently using workaround in vm-infra ansible playbook to create
~/.config/zsh/and symlink.zshrcmanually after dotfiles installation. Would prefer to fix root cause in dotfiles repo.Labels
bug, xdg-compliance, zsh