fix(installer): improve shell detection and fix Fish shell PATH injection#378
Closed
hobostay wants to merge 1 commit intoRightNow-AI:mainfrom
Closed
fix(installer): improve shell detection and fix Fish shell PATH injection#378hobostay wants to merge 1 commit intoRightNow-AI:mainfrom
hobostay wants to merge 1 commit intoRightNow-AI:mainfrom
Conversation
…tion - Add robust shell detection using shell-specific env vars (FISH_VERSION, ZSH_VERSION, BASH) - Add fallback to parent process detection via ps - Use fish_add_path command for Fish 3.3+ with fallback for older versions - Fix issue RightNow-AI#372 where Bash syntax was incorrectly injected into Fish config This fixes the problem where users with Fish shell as their default shell would get Bash export syntax in their config.fish, breaking the shell.
Member
|
Shell detection was reimplemented in v0.3.25. The original had a bug where the BASH env var short-circuited detection, breaking Zsh users. |
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.
Fixes #372
Problem
The installer script only used the
/bin/zshenvironment variable to detect the user's shell. However,/bin/zshreflects the login shell (e.g., /bin/bash or /bin/zsh), not the shell actually being used. When users ran the installer script from Fish shell, it would incorrectly inject Bash export syntax into theirconfig.fish, breaking the shell.Solution
Added
detect_shell()function with multi-layer detection:FISH_VERSION,ZSH_VERSION,BASH)/bin/zshenvironment variablepscommandImproved Fish shell handling:
fish_add_pathcommand (recommended for Fish 3.3+)set -gx PATHfor older Fish versions