nushell/crates/nu-cli/src
Nguyễn Hồng Quân 273226d666
Provide more directories autocomplete for "overlay use" (#15057)
## Description

- Fixes #12891
- An escape for #12835

Currently, Nushell is not very friendly to Python workflow, because
Python developers very often need to activate a virtual environment, and
in some workflow, the _activate.nu_ script is not near to "current
working directory" (especially ones who use
[virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/)
and [Poetry](https://python-poetry.org/)), and hence, is not
auto-completed for `overlay use`.
Though Nu v0.102.0 has improved auto-complete for `overlay use`, it
doesn't work if user starts the file path with `~` or `/`, like:

```nu
> overlay use /h
```
```nu
> overlay use ~/W
```

### Before:


![image](https://github.com/user-attachments/assets/8b668c21-0f3a-4d6f-9cd2-8cc92460525c)

### After:


![image](https://github.com/user-attachments/assets/ca491e64-774a-48d4-8f4f-58d647e011df)


![image](https://github.com/user-attachments/assets/4e097008-b5e1-4f63-af80-c1697025d4ad)



## User-Facing Changes

No

## Tests + Formatting

Passed

---------

Co-authored-by: blindfs <blindfs19@gmail.com>
2025-02-17 12:52:07 -05:00
..
commands Refactor/fix tests affecting the whole command set (#15073) 2025-02-11 11:36:36 +01:00
completions Provide more directories autocomplete for "overlay use" (#15057) 2025-02-17 12:52:07 -05:00
menus Replace raw usize IDs with new types (#13832) 2024-09-30 13:20:15 +02:00
config_files.rs Refactor I/O Errors (#14927) 2025-01-28 16:03:31 -06:00
eval_cmds.rs Convert Path to list in main and preserve case (#14764) 2025-01-10 10:18:44 -06:00
eval_file.rs Replaced IoError::new_with_additional_context calls that still had Span::unknown() (#15056) 2025-02-08 09:23:28 -06:00
lib.rs Set current working directory at startup (#12953) 2024-09-25 13:04:26 -05:00
nu_highlight.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
print.rs Rely on display_output hook for formatting values from evaluations (#14361) 2024-11-19 21:04:29 +08:00
prompt_update.rs stop the prompt from removing the last newline (#14590) 2025-01-02 09:48:35 -06:00
prompt.rs Make get_env_var return a reference to a Value (#13987) 2024-10-02 13:05:48 +02:00
reedline_config.rs Revert / vi binding due to priority bug (#15111) 2025-02-13 16:29:08 +01:00
repl.rs fix(completion): DotNuCompletion now completes nu scripts in const $NU_LIB_DIRS (#14955) 2025-01-29 05:54:12 -06:00
syntax_highlight.rs Custom command attributes (#14906) 2025-02-11 06:34:51 -06:00
util.rs fix(completion): DotNuCompletion now completes nu scripts in const $NU_LIB_DIRS (#14955) 2025-01-29 05:54:12 -06:00
validation.rs Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00