You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide better error output for missing environment variables #8543
While this output is technically correct, as Nushell sees the environment in terms of columns, I personally think it'd be more helpful to provide a more domain-specific error type and message, such as:
Error: nu::shell::env_var_not_set
× Attempting to access an un-set environment variable
╭─[entry #1:1:1]
1 │ echo $env.FOO
· ──┬─ ─┬─
· │ ╰── environment variable 'FOO' not set
· ╰── value originates here
╰────
How to reproduce
Run $env.{VAR} for any unset {VAR}
Expected behavior
If I weren't already familiar with Nushell or with a specific bit of Nushell logic, I would expect to get more direct feedback when trying to access an un-set environment variable.
Screenshots
No response
Configuration
This should be the case with any Nushell config AFAIK.
The problem here is that follow_cell_path_helper doesn't know the record's name, and it can't get it from the span, because the global state isn't passed to it.
In theory it could check if the record has config/theme/PATH fields, but this feels more like an ugly hack.
Activity
fdncred commentedon Mar 20, 2023
Agreed. It would be nice to be more verbose with the error message.
harshalchaudhari35 commentedon Mar 20, 2023
@rgwood I can take this is up, if still available. I'm new to nushell and rust as a lang but with a bit of steer I can figure it out.
rgwood commentedon Mar 20, 2023
@harshalchaudhari35 This one might be a bit of a stretch for someone new to both Nushell and Rust, but feel free to give it a try.
kaathewisegit commentedon Nov 6, 2023
The problem here is that
follow_cell_path_helperdoesn't know the record's name, and it can't get it from the span, because the global state isn't passed to it.In theory it could check if the record has
config/theme/PATHfields, but this feels more like an ugly hack.kronberger-droid commentedon Nov 13, 2026
Still the generic error on 0.117.
$env.FOOgivescolumn_not_foundwith a help text about rows anddefault, which doesn't fit an environment variable.Make error output for missing environment variables more specific (nu…