fix(shell-setup): install oh-my-zsh non-interactively

oh-my-zsh's install script, even with RUNZSH=no/CHSH=no, still prompts
"Do you want to overwrite it with the Oh My Zsh template? [Y/n]" in interactive
mode — which hangs an unattended/answerfile install at the shell-setup module.

Pass --unattended to skip all prompts, and KEEP_ZSHRC=yes so it preserves the
dotfiles ~/.zshrc symlink (created earlier in this module) instead of replacing
it with the oh-my-zsh template.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5kHioUMK3mtf2eiLEozCM
main
Amir Alexander Abdelbaki 2026-06-27 02:11:55 +02:00
parent 61ff61d432
commit 9a711013ce
1 changed files with 9 additions and 3 deletions

View File

@ -219,11 +219,17 @@ fi
# WHY: oh-my-zsh provides the plugin framework, completion system, and themes # WHY: oh-my-zsh provides the plugin framework, completion system, and themes
# that our .zshrc configuration depends on. It installs to ~/.oh-my-zsh/. # that our .zshrc configuration depends on. It installs to ~/.oh-my-zsh/.
# HOW: Download and run the official install script. # HOW: Download and run the official install script.
# RUNZSH=no: don't switch to zsh and start a new shell during install # --unattended: skip ALL interactive prompts — crucially the "overwrite .zshrc?"
# CHSH=no: don't automatically change the default shell (we do that explicitly below) # question, which otherwise hangs an automated install. It also
# implies RUNZSH=no and CHSH=no.
# KEEP_ZSHRC=yes: do NOT replace ~/.zshrc with the oh-my-zsh template. We already
# symlinked ~/.zshrc to the dotfiles copy above; without this the
# installer would clobber that symlink with its own template.
# RUNZSH=no / CHSH=no kept explicit for clarity (we change the shell ourselves below).
if [ ! -d "$HOME/.oh-my-zsh" ]; then if [ ! -d "$HOME/.oh-my-zsh" ]; then
log "Installing oh-my-zsh..." log "Installing oh-my-zsh..."
RUNZSH=no CHSH=no sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" KEEP_ZSHRC=yes RUNZSH=no CHSH=no \
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
else else
skip "oh-my-zsh already installed." skip "oh-my-zsh already installed."
fi fi