fix(install): shell-aware PATH instruction (bash/zsh/fish/tcsh/csh)#128
Merged
George-iam merged 1 commit intomainfrom May 6, 2026
Merged
fix(install): shell-aware PATH instruction (bash/zsh/fish/tcsh/csh)#128George-iam merged 1 commit intomainfrom
George-iam merged 1 commit intomainfrom
Conversation
install.sh used to unconditionally print the bash/zsh `export PATH=...` form, leaving tcsh / csh / fish users with non-working snippets. tcsh in particular doesn't auto-add ~/.local/bin to PATH the way bash and zsh do on most Linux distros (~/.profile is bash-only), so those users could not run axme-code at all after install — that was the user-visible bug reported on a tcsh machine. Detect the login shell from $SHELL (fallback: getent passwd) and print the correct syntax + rc file for the detected shell: - bash → ~/.bashrc export PATH="...:$PATH" - zsh → ~/.zshrc export PATH="...:$PATH" - fish → config.fish set -gx PATH ... $PATH - tcsh → ~/.tcshrc setenv PATH ...:$PATH - csh → ~/.cshrc setenv PATH ...:$PATH Unknown shells get a fallback listing all four forms. No auto-edit of rc files — user runs the printed command. Same model as deno / starship / nvm. install.ps1 is unaffected (Windows already auto- writes User PATH via [Environment]::SetEnvironmentVariable). Also: gate `main "$@"` on `BASH_SOURCE[0] = $0` so `source install.sh` no longer triggers a real download + install. Lets the new helpers be unit-tested directly. Smoke-tested all 6 branches manually via `SHELL=... bash -c 'source install.sh; print_path_instruction /tmp/x'`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> #!axme pr=none repo=AxmeAI/axme-code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
install.shpreviously printed only the bash/zshexport PATH=...form regardless of the user's shell. On tcsh that snippet is invalid syntax, AND~/.local/binis not on PATH by default for tcsh (most distros add it via~/.profile, which tcsh doesn't read), so tcsh users could not runaxme-codeafter install. Reported by user on a tcsh machine today.Changes
$SHELL(fallback:getent passwd).~/.bashrcexport PATH="...:$PATH"~/.zshrcexport PATH=...~/.config/fish/config.fishset -gx PATH ... $PATH~/.tcshrcsetenv PATH ...:$PATH~/.cshrcsetenv PATH ...:$PATHinstall.ps1unchanged — Windows installer already auto-writes User PATH via[Environment]::SetEnvironmentVariable.Bonus
main "$@"now gated behindBASH_SOURCE[0] = $0sosource install.shno longer fires a real download + install. Lets the helper functions be unit-tested without touching the live binary. (Caught while smoke-testing this very PR — accidentally re-ran an install during a sourced test.)Test plan
bash -n install.shclean.SHELL=... bash -c 'source install.sh; print_path_instruction /tmp/x'— each prints correct syntax + rc-file.CHANGELOG
Added under
[Unreleased]. No version bump in this PR.🤖 Generated with Claude Code