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>
This commit is contained in:
2026-03-24 18:08:50 +00:00
parent ffd26e06d6
commit a2b82b6aef
2 changed files with 11 additions and 0 deletions

View File

@@ -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"

2
home/.bashrc Normal file
View File

@@ -0,0 +1,2 @@
# Non-login shells read .bashrc; source .bash_profile for unified setup
[ -f "$HOME/.bash_profile" ] && source "$HOME/.bash_profile"