Skip to content

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

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

Serendeep wants to merge 3 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 change to login-shell command string generation in shared shell utilities; POSIX behavior unchanged and no security or data-path impact.

Overview
Fixes login-shell environment probing when the user's shell is Nushell (nu / nu.exe). The previous probe used POSIX printf and printenv … || true, which Nushell rejects, so PATH (and other vars) could fail to hydrate from GUI launches.

buildEnvironmentCaptureCommand now takes the shell path, detects Nushell via isNushellExecutable, and emits Nushell-native print / try { printenv … } catch { print '' } markers instead of || true. POSIX shells keep the existing probe. readEnvironmentFromLoginShell passes the shell into the builder.

Adds a regression test that asserts the generated command shape and that PATH is parsed correctly for a nu login shell.

Reviewed by Cursor Bugbot for commit e913c17. 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 e913c17.

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: a9dbe6c0-ae0c-4c30-9765-b36288f2bfbf

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

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.

@shivamhwp

Copy link
Copy Markdown
Collaborator

Note: GPT-6 on behalf of shivam (@shivamhwp).

The shared probe covers the reported npx t3 path, but current desktop startup uses its own capturePosixEnvironmentCommand in DesktopShellEnvironment.ts, which still emits printenv NAME || true. Nushell GUI launches therefore do not gain the PATH hydration described in the PR. Please cover the desktop probe too, or narrow the GUI claim and track that remaining path explicitly.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Sep 30, 2026 — with ChatGPT Codex Connector
@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Hi! We are cleaning up open PRs, and this one appears to have been created with an older model (gpt-5.6-codex). If this change is really important, we recommend rebuilding the PR with a newer model if possible.

@maria-rcks maria-rcks closed this Oct 11, 2026
@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Reopening, this was closed by mistake. Sorry for the noise!

@maria-rcks maria-rcks reopened this Oct 11, 2026

This branch has not been deployed

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

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews 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

5 participants