diff --git a/bin/arty b/bin/arty index a6f6ffa..9119a5f 100755 --- a/bin/arty +++ b/bin/arty @@ -1362,7 +1362,9 @@ cmd_completion() { echo "$content" > "$dest" log_success "$shell completion installed: $dest" - [[ "$shell" == "bash" ]] && log_info "Reload: source $dest" + if [[ "$shell" == "bash" ]]; then + log_info "Reload: source $dest" + fi } # USAGE AND HELP diff --git a/bin/setup b/bin/setup index cbbdda3..32a7b6a 100755 --- a/bin/setup +++ b/bin/setup @@ -99,7 +99,7 @@ detect_os() { # ─── Step 1: Prerequisites ──────────────────────────────────────────────────── check_prerequisites() { - step_header "Step 1 of 6 — Prerequisites" + step_header "Step 1 of 7 — Prerequisites" detect_os log_info "OS detected: ${BOLD}$OS${NC}" @@ -310,7 +310,8 @@ install_completion() { # arty completion zsh --install writes to the first writable fpath dir, # defaulting to ~/.zsh/completions/_arty (which .zshenv/oh-my-zsh picks up). - if ! (cd "$HOME" && "$arty_bin" completion zsh --install); then + (cd "$HOME" && "$arty_bin" completion zsh --install) || true + if [[ ! -f "$HOME/.zsh/completions/_arty" ]]; then log_warn "arty completion zsh --install failed — skipping." fi } @@ -348,10 +349,13 @@ main() { install_completion # Step 6 post_install # Step 7 - # Hand off to zsh immediately — no need to exec zsh manually. - if command -v zsh >/dev/null 2>&1; then - exec zsh -l + # Hand off to a zsh login shell immediately. + # Read from /dev/tty so zsh gets the terminal, not the leftover pipe bytes + # from the curl|sh pattern (which still has the tail of this script buffered). + if command -v zsh >/dev/null 2>&1 && [[ -e /dev/tty ]]; then + exec zsh -l