From 33b5f9cd1443c10990fdbe1d820fa727ee5ea37c Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 12 Mar 2026 13:22:36 -0400 Subject: [PATCH 1/2] Alter PATH for login shells, not interactive shells The installer was adding PATH exports to .bashrc/.zshrc, which are rc files for interactive shells. PATH belongs in login-shell startup files (~/.profile, ~/.bash_profile, ~/.zprofile) so it is set once per session and inherited by all child processes. --- install.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 1ae34a19..02e5934e 100755 --- a/install.sh +++ b/install.sh @@ -151,11 +151,19 @@ if ! command -v copilot >/dev/null 2>&1; then echo "" echo "Notice: $INSTALL_DIR is not in your PATH" - # Detect shell rc file + # Detect shell profile file for PATH case "$(basename "${SHELL:-/bin/sh}")" in - zsh) RC_FILE="$HOME/.zshrc" ;; - bash) RC_FILE="$HOME/.bashrc" ;; - *) RC_FILE="$HOME/.profile" ;; + zsh) RC_FILE="$HOME/.zprofile" ;; + bash) + if [ -f "$HOME/.bash_profile" ]; then + RC_FILE="$HOME/.bash_profile" + elif [ -f "$HOME/.bash_login" ]; then + RC_FILE="$HOME/.bash_login" + else + RC_FILE="$HOME/.profile" + fi + ;; + *) RC_FILE="$HOME/.profile" ;; esac # Prompt user to add to shell rc file (only if interactive) From 10fc28466edee641b23c77353ea6f7746ebc665a Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 12 Mar 2026 14:47:49 -0400 Subject: [PATCH 2/2] Incorporate ZDOTDIR into .zprofile path Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 02e5934e..61caf872 100755 --- a/install.sh +++ b/install.sh @@ -153,7 +153,7 @@ if ! command -v copilot >/dev/null 2>&1; then # Detect shell profile file for PATH case "$(basename "${SHELL:-/bin/sh}")" in - zsh) RC_FILE="$HOME/.zprofile" ;; + zsh) RC_FILE="${ZDOTDIR:-$HOME}/.zprofile" ;; bash) if [ -f "$HOME/.bash_profile" ]; then RC_FILE="$HOME/.bash_profile"