fix(shared): hydrate PATH with Nushell login shells - #7894
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cadd271. Configure here.
ApprovabilityVerdict: Skipped Macroscope did not run approvability analysis for this PR. Macroscope could not determine whether this PR modifies its approvability configuration, so the PR was not approved automatically. A PR that may change the rules that govern approval is never approved automatically. |

Problem
T3 Code appends
|| truewhen reading environment variables from a login shell. Nushell does not support that POSIX operator, so PATH hydration fails whennuis the user's login shell and GUI launches can inherit an incomplete environment.Fix
nuandnu.exelogin-shell executables.print/trymarker probe so captured values remain on stdout.Validation
vp test run packages/shared/src/shell.test.ts— 30 passedvp run --filter @t3tools/shared typecheckCloses #7846
Built with GPT-5.6 Codex in T3 Code.
Note
Low Risk
Narrow command-generation change for env capture, with POSIX path unchanged and a focused unit test. No auth or data-handling impact.
Overview
Fixes login-shell env capture when the user’s shell is Nushell (
nu/nu.exe). POSIXprintenv VAR || trueis invalid there, so PATH hydration failed for GUI launches.buildEnvironmentCaptureCommandnow takes the shell path and emits Nushellprint/try { printenv … } catch { print '' }probes instead ofprintfand|| true. Other shells keep the existing POSIX command. Adds a regression test that asserts the generated command and extractedPATH.Reviewed by Cursor Bugbot for commit ea33634. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
readEnvironmentFromLoginShellto support Nushell login shellsisNushellExecutablehelper in shell.ts to detect Nushell shells by checking fornuornu.exe.buildEnvironmentCaptureCommandto accept the shell path and generate a Nushell-compatible command usingprintandtry/catchinstead of|| true.readEnvironmentFromLoginShellto pass the shell path to the command builder.buildEnvironmentCaptureCommandnow requires a shell path argument, but existing non-Nushell shell command generation remains unchanged.Macroscope summarized ea33634.