fix: detect invoking shell for init - #142
Open
lilien1010 wants to merge 2 commits into
Open
Conversation
Assisted-By: devx/81468caa-b221-4aa1-a09a-044e49944132
A non-shell parent (script runner, make, non-exec wrapper) would otherwise override a correct $SHELL=fish and emit bash syntax. Fall back to $SHELL unless the parent name looks like a shell. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Assisted-By: devx/29cc08f5-8976-4c01-bdc7-ff3402fcbfbb
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
try initfrom its parent process before consulting$SHELL$SHELLwhen parent-process detection is unavailableContext
$SHELLis the login shell, so it can differ from the shell sourcingtry init. Parent-process detection was added in 4cf1364 after #72, but only as a fallback when$SHELLis empty, leaving the reported case broken.Fixes #141.
Verification
SHELL=/bin/zshrake test: 131 unit tests and 401/401 specs passedtry init | sourcedefines the function in a real fish process withSHELL=/bin/zshSpinel was not available locally, so the native checks were skipped by the existing Rake task.