fix: support Fish shell's space-separated PATH format #172
+10
−1
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.
Hey 👋
I spontaneously decided to give it a try to #171 and see if i can fix Fish support. I hope this doesn't bother you, if so, feel free to close the PR.
Fish shell uses space-separated PATH variables internally (as a proper list), while other shells like bash and zsh use colon-separated strings. When Expert tried to detect the Elixir executable by running
echo $PATH
in Fish, it received space-separated output like:/opt/homebrew/bin /opt/homebrew/sbin /Users/username/.local/bin ...
This caused
:os.find_executable/2
to fail since it expects colon-separated paths on Unix systems, preventing Fish users from using Expert properly.Proposed Solution
This PR adds Fish-specific handling to convert the
PATH
to the expected colon-separated format:String.contains?(shell, "fish")
string join ':' $PATH
to convert Fish's list format to colon-separatedstring join ...
is built-in in Fish and available since version 2.3.0 (2016)💡 This approach correctly handles paths with spaces in them (e.g.,
/Applications/Visual Studio Code.app/bin
) because it works with Fish's native list structure rather than trying to parse space-separated strings.Testing
Tested with Fish shell + Mise on macOS, where Elixir executable is now correctly found 🚀
Let me know if the solution is good enough for you, or if is there anything missing.
Cheers ✌️