fix: detect fish shell via FISH_VERSION when login shell differs#264
fix: detect fish shell via FISH_VERSION when login shell differs#264rafa-thayto merged 2 commits intomainfrom
Conversation
On macOS, $SHELL stays /bin/zsh even when running fish, causing `clerk doctor` to report zsh output and `clerk update` to show an irrelevant `hash -r` hint. Check FISH_VERSION (always exported by fish) as a fallback when $SHELL doesn't say fish.
🦋 Changeset detectedLatest commit: 13e515e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
!snapshot |
Snapshot publishednpm install -g clerk@1.1.3-snapshot.g7082776
|
Summary
clerk doctorshell detection for fish users whose login shell ($SHELL) is zsh — now checksFISH_VERSIONenv var as a fallbackclerk updateshowing an irrelevanthash -rhint to the same usersdelete process.env.FISH_VERSIONguard in testbeforeEachto prevent contamination when running tests from fishDetails
On macOS,
$SHELLreflects the login shell from/etc/passwd, not the active shell. Fish doesn't overwrite$SHELL— it setsFISH_VERSIONinstead. This caused two bugs:clerk doctor—detectShell()read only$SHELL, so fish users with a zsh login shell saw zsh completion diagnosticsclerk update—hashHint()checked$SHELLfor fish, missed it, and showed ahash -rhint (fish auto-rehashes, so this is noise)The fix checks
$SHELLfirst for bash/zsh (which don't export their version vars to children), then falls back toFISH_VERSION. This handles both the primary case (fish with zsh login shell) and the edge case (bash/zsh launched from within fish, whereFISH_VERSIONis still inherited).Test plan
FISH_VERSIONwhenSHELLis unsetSHELLoverFISH_VERSIONwhenSHELLis bash or zsh (bash-inside-fish edge case)SHELLpoints to an unrecognized shell (/bin/csh)beforeEachclearsFISH_VERSIONso tests are stable regardless of runner shell