Skip to content

PATH hydration fails when the login shell is nushell #7846

Open

Description

@mirsella

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.

Activity

  1. u-k-g commented on Sep 3, 2026

    @u-k-g

    +1
    this happens to me too.
    NixOS
    Login shell: /run/current-system/sw/bin/nu
    T3 connect version: 0.0.38

    $ t3 serve

    Failed to read PATH from login shell /run/current-system/sw/bin/nu.
    
    Command failed:
    /run/current-system/sw/bin/nu -ilc printf '%s\n' '__T3CODE_ENV_PATH_START__'; printenv PATH || true; printf '%s\n' '__T3CODE_ENV_PATH_END__'
    
    Error: nu::parser::shell_oror
    
    The '||' operator is not supported in Nushell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions