diff --git a/crates/nu-utils/src/default_files/default_env.nu b/crates/nu-utils/src/default_files/default_env.nu index 66b442ce7a..ae2f1ae719 100644 --- a/crates/nu-utils/src/default_files/default_env.nu +++ b/crates/nu-utils/src/default_files/default_env.nu @@ -17,11 +17,6 @@ $env.PROMPT_COMMAND = $env.PROMPT_COMMAND? | default {|| $path_segment | str replace --all (char path_sep) $"($separator_color)(char path_sep)($path_color)" } -$env.PROMPT_INDICATOR = $env.PROMPT_INDICATOR? | default "> " -$env.PROMPT_INDICATOR_VI_NORMAL = $env.PROMPT_INDICATOR_VI_NORMAL? | default "> " -$env.PROMPT_INDICATOR_VI_INSERT = $env.PROMPT_INDICATOR_VI_INSERT? | default ": " -$env.PROMPT_MULTILINE_INDICATOR = $env.PROMPT_MULTILINE_INDICATOR? | default "::: " - $env.PROMPT_COMMAND_RIGHT = $env.PROMPT_COMMAND_RIGHT? | default {|| # create a right prompt in magenta with green separators and am/pm underlined let time_segment = ([ diff --git a/src/main.rs b/src/main.rs index 7d39aef02b..4ebc215531 100644 --- a/src/main.rs +++ b/src/main.rs @@ -320,9 +320,29 @@ fn main() -> Result<()> { "NU_VERSION".to_string(), Value::string(env!("CARGO_PKG_VERSION"), Span::unknown()), ); - // Add SHLVL if interactive if engine_state.is_interactive { + engine_state.add_env_var("PROMPT_INDICATOR".to_string(), Value::test_string("> ")); + engine_state.add_env_var( + "PROMPT_INDICATOR_VI_NORMAL".to_string(), + Value::test_string("> "), + ); + engine_state.add_env_var( + "PROMPT_INDICATOR_VI_INSERT".to_string(), + Value::test_string(": "), + ); + engine_state.add_env_var( + "PROMPT_MULTILINE_INDICATOR".to_string(), + Value::test_string("::: "), + ); + engine_state.add_env_var( + "TRANSIENT_PROMPT_MULTILINE_INDICATOR".to_string(), + Value::test_string(""), + ); + engine_state.add_env_var( + "TRANSIENT_PROMPT_COMMAND_RIGHT".to_string(), + Value::test_string(""), + ); let mut shlvl = engine_state .get_env_var("SHLVL") .map(|x| x.as_str().unwrap_or("0").parse::().unwrap_or(0))