New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hide
and hide-env
sometimes doesn't hide env vars
#6593
Comments
It's not woking on Windows. |
@gotounix Just FYI, once this PR lands pypa/virtualenv#2422 the virtualenv activation script will use the overlay system to activate the environment variables, so the This |
I also noticed this behavior and reported it here. I'm using nushell on MacOS. Any update? |
# Description This one fixes env not being hidden inside closure, reported in the conversation under #6593 #6593 #7937 still persist. These seems a bit more involved and might need hidden env tracking also in the engine state... I'm not yet sure what's causing it. Also re-enables some env-related tests and removes unused Value clone. # User-Facing Changes Just a bugfix # Tests + Formatting Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date.
related to #7937 |
I've investigated more and it seems like this one more closely related to #7937 than I thought, since, for me, I'd have to have this env var set in a parent shell to repro this problem. I'm closing it. If anyone still has these issues, ping me and I'll reopen it. |
Describe the bug
Sometimes
hide
andhide-env
won't hide environment variables. It seems to work fine on Windows but I can't get it to work on WSL/Ubuntu.How to reproduce
alias lsg = (ls | sort-by type name -i | grid -c)
hide LS_COLORS
orhide-env LS_COLORS
. I do this so that there is no possibility of a parent shell having aLS_COLORS
env var and nushell inheriting it.Expected behavior
Based on the example above, every time you change directory you should get a
lsg
output with the default nushellLS_COLORS
. What's happening is there is someLS_COLORS
being inherited in WSL and therefore the colors are wrong.Screenshots
No response
Configuration
Additional context
This seems to only happen when you have a parent shell. Also of note is that if you just type
lsg
in the repl, the colors are correct. So, in the repl, thehide
is working. It's just not working right in the hook.The text was updated successfully, but these errors were encountered: