nushell/crates/nu-cli
Antoine Stevan 9d7a1097f2
Fix default prompt indicators (#9914)
related to
- https://github.com/nushell/nushell/pull/9907

# Description
https://github.com/nushell/nushell/pull/9907 removed the front space
from all `PROMPT_INDICATOR`s but this is not what the default behaviour
of Nushell is, i.e. in `nu --no-config-file`.

this PR
- removes the space that is prepended by Nushell before the prompt
indicator to match the `default_env.nu`
- swaps INSERT and NORMAL in the Rust code to match the `:` and `>`
respectively in `default_env.nu`

## 🔍 try the changes
> **Warning**
> i had to comment out in my config all the `$env.PROMPT_INDICATOR... =
...` to avoid these variables to propagate to `cargo run -- -n`

in either `cargo run -- -n` or `cargo run -- --config
crates/nu-utils/src/sample_config/default_config.nu --env-config
crates/nu-utils/src/sample_config/default_env.nu`,
- see `/path/to/nushell>` as the prompt with the default `emacs` edit
mode
- run `$env.config.edit_mode = vi`
- see `/path/to/nushell:` as the INSERT prompt in Vi mode
- press Escape to go into NORMAL mode
- see `/path/to/nushell>` as the NORMAL prompt in Vi mode
- press I to go back into INSERT mode
- see `/path/to/nushell:` as the INSERT prompt in Vi mode

# User-Facing Changes
the prompts in `nu --no-config-file` and `nu --config default_config.nu
--env-config default_env.nu` should be the same 😌

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
-  `toolkit test`
-  `toolkit test stdlib`

# After Submitting
2023-08-05 04:47:46 +12:00
..
src Fix default prompt indicators (#9914) 2023-08-05 04:47:46 +12:00
tests Let with pipeline (#9589) 2023-07-03 17:45:10 +12:00
Cargo.toml bump to dev version 0.83.2 (#9866) 2023-07-30 22:16:57 +02:00
LICENSE Fix rest of license year ranges (#8727) 2023-04-04 09:03:29 +12:00