The main issue with ZSH's CDPATH handling was:
- In ZSH, the
cdpath
variable needs to be converted from CDPATH string to array format - CDPATH setting was conditional on zsh-completions being installed
- The
cd
function from aliases needs to be loaded after CDPATH is set
- Made CDPATH setup unconditional so it always runs
- Added proper conversion from CDPATH to cdpath array:
# Convert CDPATH (colon separated string) to cdpath (array) cdpath=(${(s.:.)CDPATH})
- Used the existing late-load mechanism in
__aliases_load
to ensure cd function is defined after CDPATH is set
-
Bash Prompt Configuration ✅:
- Kept the default zsh prompt as oh-my-zsh will override it anyway
- zsh theme is set to "amuse" in oh-my-zsh configuration
-
Color Settings ✅:
- Added color settings for directories to zshrc
- Matched the bash settings for both OSX and Linux
-
Shell Variable Differences ✅:
- Added
SHELL
definition for Ubuntu in zshrc - Set to /usr/bin/env zsh (instead of bash)
- Added
-
Tool-specific Completions ✅:
- Added simple git completion fallback if oh-my-zsh isn't used
- Relies on oh-my-zsh's built-in git plugin for completions when available
-
Go Path Configuration ✅:
- Fixed GOPATH in zshrc to use
$HOME/go
instead of$HOME/src/Go
- Fixed GOPATH in zshrc to use
-
SSH Agent Configuration ✅:
- Fixed: Added interactive shell check for SSH-add in zshrc to match bashrc
-
pgrep Command ✅:
- In bashrc, pgrep with
-u $USER
parameter (line 90) - Fixed: Added -u $USER parameter to pgrep commands in zshrc
- In bashrc, pgrep with
-
Bun Shell Integration ✅:
- Added Bun shell integration to bashrc to match zshrc configuration
- Both shells now source the _bun integration file if available
-
ZSH Completion ✅:
- Fixed: Replaced hardcoded user path with $HOME in Deno completions
-
Conda Initialization ✅:
- Fixed: Replaced hardcoded user paths with $HOME in conda setup
- Note: The implementations are different but both are generated by conda itself
-
Configuration Structure:
- Consolidate common code between zshrc and bashrc into shared files
- Create a common config format that both shells can source
-
Feature Parity:
- Ensure all functions and aliases work identically in both shells
- Document any intentional differences
-
Error Handling:
- Add better error handling for missing directories or commands
- Add fallback mechanisms for environment detection
-
Performance:
- Profile shell startup time and optimize slow parts
- Consider lazy-loading for rarely used functions
-
Documentation:
- Add better commenting for ZSH-specific features
- Document the purpose of each configuration section
-
Immediate Fixes:
- Fix CDPATH and cd behavior in zshrc
- Fix SSH agent configuration
- Fix pgrep command in zshrc
-
Short-term Improvements:
- Port prompt configuration from bashrc to zshrc
- Standardize completion handling
- Fix path settings (GOPATH, etc.)
-
Long-term Refactoring:
- Create shared configuration system
- Improve modularity and performance
- Add comprehensive documentation