Describe the bug
I'm using Starship for my prompt configuration.
Whenever I start a nu -n to test something in a "clean" environment, I have no prompt indicator.
How to reproduce
Load the starship/init.nu generated by Starship or follow the Nushell Book instructions on configuring third-party prompts.
Start a new shell with nu -n
The prompt indicator (as well as the multiline, which isn't a big deal for me) will be missing. I.e., instead of:
You'll have:
Expected behavior
Loading a nu -n will result in a shell with all configuration options set to their defaults, including prompt indicator.
Screenshots
No response
Configuration
I'm two releases back on this particular installation, but AFAIK the problem will still be present on newer releases (see Additional Context below).
| key |
value |
| version |
0.89.0 |
| branch |
|
| commit_hash |
|
| build_os |
linux-x86_64 |
| build_target |
x86_64-unknown-linux-gnu |
| rust_version |
rustc 1.75.0 (82e1608df 2023-12-21) (built from a source tarball) |
| cargo_version |
cargo 1.75.0 |
| build_time |
1980-01-01 00:00:00 +00:00 |
| build_rust_channel |
release |
| allocator |
mimalloc |
| features |
dataframe, default, extra, sqlite, trash, which, zip |
| installed_plugins |
from eml, from ics, from ini, from vcf, query, query json, query web, query xml |
Additional context
This is due to the fact that Starship sets:
$env.PROMPT_INDICATOR = ""
And the new session created with nu -n inherits this value, but doesn't run Starship. A new Nushell will reset (not inherit) $env.config, but other environment variables are not reset (are inherited).
Two possible fixes that I can think of:
-
If possible, move $env.PROMPT_INDICATOR (and related) to $env.config.PROMPT_INDICATOR to be consistent with other configuration settings. I say, "if possible", because I'm assuming there might be a reason that it isn't already, but I don't know.
-
Reset $env.PROMPT_INDICATOR (and related) to default values on startup.
Describe the bug
I'm using Starship for my prompt configuration.
Whenever I start a
nu -nto test something in a "clean" environment, I have no prompt indicator.How to reproduce
Load the
starship/init.nugenerated by Starship or follow the Nushell Book instructions on configuring third-party prompts.Start a new shell with
nu -nThe prompt indicator (as well as the multiline, which isn't a big deal for me) will be missing. I.e., instead of:
You'll have:
~commandlineExpected behavior
Loading a
nu -nwill result in a shell with all configuration options set to their defaults, including prompt indicator.Screenshots
No response
Configuration
I'm two releases back on this particular installation, but AFAIK the problem will still be present on newer releases (see Additional Context below).
Additional context
This is due to the fact that Starship sets:
And the new session created with
nu -ninherits this value, but doesn't run Starship. A new Nushell will reset (not inherit)$env.config, but other environment variables are not reset (are inherited).Two possible fixes that I can think of:
If possible, move
$env.PROMPT_INDICATOR(and related) to$env.config.PROMPT_INDICATORto be consistent with other configuration settings. I say, "if possible", because I'm assuming there might be a reason that it isn't already, but I don't know.Reset
$env.PROMPT_INDICATOR(and related) to default values on startup.