From 7f5991c1bdc01baae3955f0911e0f0986c0a9a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Mon, 22 Jun 2026 16:26:13 +0200 Subject: [PATCH] fix: setup and arty completion bugs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bin/setup: - Fix Step 1 of 6 → Step 1 of 7 - exec zsh -l --- bin/arty | 4 +++- bin/setup | 14 +++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) 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