diff --git a/crates/nu-std/std/log.nu b/crates/nu-std/std/log.nu index 88df43309a..2c412112ba 100644 --- a/crates/nu-std/std/log.nu +++ b/crates/nu-std/std/log.nu @@ -282,7 +282,9 @@ export def custom [ $level_prefix } - let ansi = if ($ansi | is-empty) { + let ansi = if not $env.config.use_ansi_coloring { + "" + } else if ($ansi | is-empty) { if ($log_level not-in $valid_levels_for_defaulting) { log-level-deduction-error "ansi" (metadata $log_level).span $log_level } diff --git a/crates/nu-utils/src/sample_config/default_env.nu b/crates/nu-utils/src/sample_config/default_env.nu index 5d6cab2687..1317436d8d 100644 --- a/crates/nu-utils/src/sample_config/default_env.nu +++ b/crates/nu-utils/src/sample_config/default_env.nu @@ -11,7 +11,7 @@ def create_left_prompt [] { let path_color = (if (is-admin) { ansi red_bold } else { ansi green_bold }) let separator_color = (if (is-admin) { ansi light_red_bold } else { ansi light_green_bold }) - let path_segment = $"($path_color)($dir)" + let path_segment = $"($path_color)($dir)(ansi reset)" $path_segment | str replace --all (char path_sep) $"($separator_color)(char path_sep)($path_color)" } @@ -98,4 +98,4 @@ $env.NU_PLUGIN_DIRS = [ # $env.PATH = ($env.PATH | uniq) # To load from a custom file you can use: -# source ($nu.default-config-dir | path join 'custom.nu') \ No newline at end of file +# source ($nu.default-config-dir | path join 'custom.nu')