Shell Configuration
Pathmaster interacts with your shell configuration files to make PATH changes persistent across sessions. This page details how pathmaster works with different shell environments.
Supported Shells
Pathmaster automatically detects and supports the following shells:
| Shell | Configuration File | Detection Method |
|———-|———————————-|————————|
| Bash | ~/.bashrc | $SHELL contains “bash”|
| Zsh | ~/.zshrc | $SHELL contains “zsh” |
| Fish | ~/.config/fish/config.fish | $SHELL contains “fish”|
| Tcsh/Csh | ~/.tcshrc | $SHELL contains “tcsh” or “csh”|
| Ksh | ~/.kshrc | $SHELL contains “ksh” |
If your shell isn’t detected, a generic handler is used as a fallback.
How Shell Detection Works
When you run pathmaster, it:
Reads the
$SHELLenvironment variableExtracts the shell name by checking for keywords in the path
Selects the appropriate handler for your shell type
Locates your shell’s configuration file
Modification Approach
When modifying your PATH, pathmaster:
Creates a backup of your shell configuration file (with
.bakextension and timestamp)Scans for existing PATH-related statements in your configuration
Removes any pathmaster-managed PATH entries
Adds standardized statements with all required paths
Adds a timestamp comment to indicate when changes were made
Shell-Specific Implementations
Bash
# Added by pathmaster on 2025-04-02 15:04:32
export PATH="/usr/local/bin:/usr/bin:/bin:/home/user/bin"
Zsh
# Added by pathmaster on 2025-04-02 15:04:32
path=(/usr/local/bin /usr/bin /bin /home/user/bin) && export PATH
Fish
# Added by pathmaster on 2025-04-02 15:04:32
set -e PATH
fish_add_path /usr/local/bin
fish_add_path /usr/bin
fish_add_path /bin
fish_add_path /home/user/bin
Tcsh
# Added by pathmaster on 2025-04-02 15:04:32
setenv PATH /usr/local/bin:/usr/bin:/bin:/home/user/bin
Ksh
# Added by pathmaster on 2025-04-02 15:04:32
export PATH=/usr/local/bin:/usr/bin:/bin:/home/user/bin
Best Practices
Let pathmaster manage your PATH: Avoid manually editing pathmaster-managed PATH statements
Check after changes: Use
pathmaster listto verify your PATH looks correctUse restore if needed: If shell configuration gets corrupted, use
pathmaster restoreto revert changesKeep configuration simple: Avoid complex PATH manipulations that might conflict with pathmaster
Troubleshooting
If changes aren’t persisting, ensure your shell is loading the configuration file pathmaster modifies
If you get “Permission denied” errors, check file permissions on your shell configuration
If you use multiple shell profiles, pathmaster only modifies the main configuration file
For custom shells or configurations, you may need to manually update your PATH