Skip to content

fix(shared): hydrate PATH with Nushell login shells - #7894

Open
Serendeep wants to merge 2 commits into
pingdotgg:mainfrom
Serendeep:agent/fix-nushell-path-hydration
Open

fix(shared): hydrate PATH with Nushell login shells#7894
Serendeep wants to merge 2 commits into
pingdotgg:mainfrom
Serendeep:agent/fix-nushell-path-hydration

Conversation

@Serendeep

@Serendeep Serendeep commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Problem

T3 Code appends || true when reading environment variables from a login shell. Nushell does not support that POSIX operator, so PATH hydration fails when nu is the user's login shell and GUI launches can inherit an incomplete environment.

Fix

  • Detect nu and nu.exe login-shell executables.
  • Use the issue-author-verified Nushell print/try marker probe so captured values remain on stdout.
  • Preserve the existing POSIX probe for other login shells.
  • Add focused regression coverage for Nushell command generation and environment extraction.

Validation

  • vp test run packages/shared/src/shell.test.ts — 30 passed
  • vp run --filter @t3tools/shared typecheck
  • Targeted formatting and lint checks for both changed files

Closes #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). POSIX printenv VAR || true is invalid there, so PATH hydration failed for GUI launches.

buildEnvironmentCaptureCommand now takes the shell path and emits Nushell print / try { printenv … } catch { print '' } probes instead of printf and || true. Other shells keep the existing POSIX command. Adds a regression test that asserts the generated command and extracted PATH.

Reviewed by Cursor Bugbot for commit ea33634. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix readEnvironmentFromLoginShell to support Nushell login shells

  • Adds isNushellExecutable helper in shell.ts to detect Nushell shells by checking for nu or nu.exe.
  • Updates buildEnvironmentCaptureCommand to accept the shell path and generate a Nushell-compatible command using print and try/catch instead of || true.
  • Updates readEnvironmentFromLoginShell to pass the shell path to the command builder.
  • Behavioral Change: buildEnvironmentCaptureCommand now requires a shell path argument, but existing non-Nushell shell command generation remains unchanged.

Macroscope summarized ea33634.

Copilot AI lite review requested due to automatic review settings August 22, 2026 11:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e5f43ede-3820-4edb-83a3-4aea159c3991

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 22, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread packages/shared/src/shell.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PATH hydration fails when the login shell is nushell

2 participants