-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add NU config to allow user be able to turn off external completion #5773
Conversation
How come this is not a config value instead of an env variable? |
You are correct, config makes more sense, I will make a quick update. Thank you for the comment |
docs/sample_config/default_config.nu
Outdated
@@ -219,6 +219,7 @@ let-env config = { | |||
disable_table_indexes: false # set to true to remove the index column from tables | |||
cd_with_abbreviations: false # set to true to allow you to do things like cd s/o/f and nushell expand it to cd some/other/folder | |||
case_sensitive_completions: false # set to true to enable case-sensitive completions | |||
enable_external_completion: true # set to false to prevent nushell looks into $env.PATH and find more suggestions, recommended for WSL users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enable_external_completion: true # set to false to prevent nushell looks into $env.PATH and find more suggestions, recommended for WSL users | |
enable_external_completion: true # set to false to prevent nushell looking into $env.PATH to find more suggestions. `false` recommended for WSL users as this look up may be very slow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment!
As I commented in #5772, this is a known issue with WSL. I'm not sure we should add this when WSL is the problem and there is a known work-around already.
My work-around is to use the I'm assuming that this just disables windows paths for completions but you can still call programs that are in your windows paths, like explorer and code, right? |
Yes, that's right, this is just for completions. Also, from end user's standpoint, I feel like we can offer user a better option to show less suggested completions (only from Nu). Say if I have dozens of DIRS in my env |
I'm still on the fence about whether this is a good idea or not.
|
I understood your concern, however, I feel like this is more than WSL itself, e.g: regards to the bullet 2, I personally do not want to see any completion outside of nu, and I believe this is not only my preference :), instead, we offer our user an option which they could turn it off if, this should be a legitimate reason. Also, the default flag value is true, uses won't feel any differences until they really see the slowness( If you guys feel like this is not the good change at this moment, I am ok with that decision too :) |
ok. let's try it out. thanks |
…ushell#5773) * 06-07-wsl * 06-07-linux-issue-with-delete-input * 06-08-2023 * 06-08-Linux * commit for merge * Fix unit test * format * clean code * Add flag to turn off external completion * change env var to config * Fix comment Co-authored-by: Frank Zhang <v-frankz@microsoft.com>
Description
Fix #5772, add an env var to let user be able to turn off external completion, this will be handy for WSL2 specifically, or
PATH
has tons of dirsTests
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 --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect
to check that you're using the standard code stylecargo test --workspace --features=extra
to check that all the tests pass