feat: add cross-shell compatibility to preserve bash config when switching to zsh#900
feat: add cross-shell compatibility to preserve bash config when switching to zsh#900marcusquinn merged 1 commit intomainfrom
Conversation
When setup installs Oh My Zsh or changes the default shell to zsh, users lose their bash customizations (PATH entries, aliases, exports, tool integrations like nvm/pyenv/brew). Add setup_shell_compatibility() that: - Scans .bash_profile, .bashrc, and .profile for portable customizations - Extracts exports, aliases, PATH entries, eval/source commands - Skips bash-specific syntax (shopt, PS1, completion, bind, etc.) - Deduplicates lines across files (handles .bash_profile sourcing .bashrc) - Creates ~/.shell_common with the extracted config - Adds sourcing to both .zshrc and bash configs - Users can then edit one file for both shells Works on macOS (bash_profile + bashrc) and Linux (bashrc + profile). Uses POSIX dot-source (.) for maximum shell compatibility. Opt-in with [Y/n] prompt, idempotent (skips if already configured).
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Tue Feb 10 03:46:41 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Summary
setup_shell_compatibility()step to setup.sh that runs after Oh My Zsh installation~/.shell_commonprofile.zshrcand bash configs source this shared file, so users maintain one config for both shellsProblem
Setup offers to install Oh My Zsh and change the default shell to zsh. Users who accept lose all their bash customizations — PATH entries, aliases, exports, and tool integrations like nvm/pyenv/brew shellenv. This is especially painful on macOS where many users have years of bash config from before Catalina switched the default to zsh.
Solution
Best-practice shared profile pattern:
.bash_profile,.bashrc, and.profilefor portable customizations~/.shell_common.bash_profilesourcing.bashrc).) to both.zshrcand bash configs~/.shell_commonfor shared settings, shell-specific files for the restPlatform Support
.bash_profile+.bashrc(both common), creates/updates.zshrc.bashrc+.profile+.bash_profile, handles all common layouts.(dot-source) instead ofsourcefor maximum compatibilityQuality
[Y/n]prompt (default yes), idempotent (skips if~/.shell_commonexists)local var="$1", explicit returns,confirm_step)