mirror of
https://github.com/nushell/nushell.git
synced 2025-07-13 12:56:22 +02:00
# Description Closes: #15755 I think it's a good feature, to achieve this, we need to get all hidden envs(it's defined in `get_hidden_env_vars`, and then restore these envs back to stack) # User-Facing Changes ### Before ```nushell > $env.foo = 'bar' > overlay new xxx > hide-env foo > overlay hide xxx > $env.foo Error: nu:🐚:column_not_found × Cannot find column 'foo' ╭─[entry #21:5:1] 4 │ overlay hide xxx 5 │ $env.foo · ────┬───┬ · │ ╰── value originates here · ╰── cannot find column 'foo' ╰──── ``` ### After ```nushell > $env.foo = 'bar' > overlay new xxx > hide-env foo > overlay hide xxx > $env.foo bar ``` ## Note But it doesn't work if it runs the example code in script: `nu -c "$env.foo = 'bar'; overlay new xxx; hide-env foo; overlay hide xxx; $env.foo"` still raises an error says `foo` doesn't found. That's because if we run the script at once, the envs in stack doesn't have a chance to merge back into `engine_state`, which is only called in `repl`. It introduces some sort of inconsistency, but I think users use overlays mostly in repl, so it's good to have such feature first. # Tests + Formatting Added 2 tests # After Submitting NaN
nu-protocol
The nu-protocol crate holds the definitions of structs/traits that are used throughout Nushell. This gives us one way to expose them to many other crates, as well as make these definitions available to each other, without causing mutually recursive dependencies.