From a2b82b6aef8826db72922c1276bbd679e533432e Mon Sep 17 00:00:00 2001 From: Andrejus Date: Tue, 24 Mar 2026 18:08:50 +0000 Subject: [PATCH] fix(bash): auto-exec zsh in Codespaces, add .bashrc .bash_profile execs into zsh when available (chsh doesn't persist in containers). Shows amber warning if zsh not found. .bashrc sources .bash_profile for non-login bash sessions (e.g. iTerm2 profiles with 'bash' command). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- home/.bash_profile | 9 +++++++++ home/.bashrc | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 home/.bashrc diff --git a/home/.bash_profile b/home/.bash_profile index 8e57b08..b5bf26d 100644 --- a/home/.bash_profile +++ b/home/.bash_profile @@ -1,3 +1,12 @@ +# Switch to zsh if available (chsh doesn't persist in containers/Codespaces) +if [[ -z "${ZSH_VERSION:-}" ]]; then + if command -v zsh &>/dev/null; then + exec zsh -l + else + printf '\033[38;2;248;140;20m[dots] zsh not found — falling back to bash\033[0m\n' >&2 + fi +fi + # Load .profile, containing login, non-bash related initializations. [ -f "$HOME/.profile" ] && source "$HOME/.profile" diff --git a/home/.bashrc b/home/.bashrc new file mode 100644 index 0000000..a3a83b1 --- /dev/null +++ b/home/.bashrc @@ -0,0 +1,2 @@ +# Non-login shells read .bashrc; source .bash_profile for unified setup +[ -f "$HOME/.bash_profile" ] && source "$HOME/.bash_profile"