change name to command_prompt (#4003)

This commit is contained in:
Fernando Herrera 2021-09-13 21:02:10 +01:00 committed by GitHub
parent cc5c4d38bb
commit fda69354db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ use std::path::PathBuf;
// Name of environment variable where the prompt could be stored
#[cfg(feature = "rustyline-support")]
const PROMPT_STRING: &str = "PROMPT_STRING";
const PROMPT_COMMAND: &str = "PROMPT_COMMAND";
pub fn search_paths() -> Vec<std::path::PathBuf> {
use std::env;
@ -301,9 +301,9 @@ pub fn cli(
let cwd = context.shell_manager().path();
// Check if the PROMPT_STRING env variable is set. This env variable
// Check if the PROMPT_COMMAND env variable is set. This env variable
// contains nu code that is used to overwrite the prompt
let colored_prompt = match context.scope.get_env(PROMPT_STRING) {
let colored_prompt = match context.scope.get_env(PROMPT_COMMAND) {
Some(env_prompt) => evaluate_prompt_string(&env_prompt, &context, &cwd),
None => {
if let Some(prompt) = &prompt {