Skip to content
Source
Sign inSign up
pingdotgg/t3code

PATH hydration fails when the login shell is nushell #7846

Closedmirsella(GitHub profile, opens in a new tab) opened this issue 1 comment

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.

  1. +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
  2. juliusmarminge closed this

Sign in to join this conversation.