From 9a711013ce5be671dd41a4980c10de5213b0dd8f Mon Sep 17 00:00:00 2001 From: The_miro Date: Sat, 27 Jun 2026 02:11:55 +0200 Subject: [PATCH] fix(shell-setup): install oh-my-zsh non-interactively MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Claude-Session: https://claude.ai/code/session_01R5kHioUMK3mtf2eiLEozCM --- setup/modules/shell-setup.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/setup/modules/shell-setup.sh b/setup/modules/shell-setup.sh index f1fcf2b..37c3579 100755 --- a/setup/modules/shell-setup.sh +++ b/setup/modules/shell-setup.sh @@ -219,11 +219,17 @@ fi # WHY: oh-my-zsh provides the plugin framework, completion system, and themes # that our .zshrc configuration depends on. It installs to ~/.oh-my-zsh/. # HOW: Download and run the official install script. -# RUNZSH=no: don't switch to zsh and start a new shell during install -# CHSH=no: don't automatically change the default shell (we do that explicitly below) +# --unattended: skip ALL interactive prompts — crucially the "overwrite .zshrc?" +# 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 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 skip "oh-my-zsh already installed." fi