pingdotgg / pingdotgg/t3code

PATH hydration fails when the login shell is nushell

Open Beginner friendly
#7,846 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

On a machine where /bin/nu is the login shell, t3 logs this warning at startup:

[server] Failed to read PATH from login shell /bin/nu

The server still runs and terminals work, but the PATH captured from the login shell is dropped. On my machine that meant tools living in user paths, like nvm-managed node and cargo binaries, did not resolve inside t3.

The probe sent to the login shell is POSIX only (packages/shared/src/shell.ts, buildEnvironmentCaptureCommand):

printf '%s\n' '__T3CODE_ENV_PATH_START__'; printenv PATH || true; printf '%s\n' '__T3CODE_ENV_PATH_END__'

Nushell rejects this at parse time with nu::parser::shell_oror: it has no || operator, and its error suggests using try instead.

Repro: Arch Linux with nu as the login shell, node v26.7.0, run npx t3@latest.

A nushell variant I verified against the real shell:

print '__T3CODE_ENV_PATH_START__'; try { printenv PATH } catch { print '' }; print '__T3CODE_ENV_PATH_END__'

Same marker shape, so extractEnvironmentValue keeps working unchanged. Detecting shells whose basename starts with nu and sending that variant fixes it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/shared/src/shell.ts at buildEnvironmentCaptureCommand and review how the login shell is selected and how extractEnvironmentValue consumes the markers. Reproduce with nushell as the login shell, then verify that PATH is retained for nushell while the existing probe continues to work for other shells.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell, typescript
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.