From a78cd6e23118cd36f0f96301d3d8855cd394c5a3 Mon Sep 17 00:00:00 2001 From: Antoine Stevan <44101798+amtoine@users.noreply.github.com> Date: Mon, 8 May 2023 20:00:44 +0200 Subject: [PATCH] FIX: add a space after the default left prompt (#9074) # Description when running `nushell` with the `--no-config-file` option, the left prompt does not have a space to separate the directory path from the user input. in this PR i add a space there to make the prompt easier to read when using `--no-config-file`! # User-Facing Changes before: https://asciinema.org/a/581733 after: https://asciinema.org/a/581734 # Tests + Formatting - :green_circle: `toolkit fmt` - :green_circle: `toolkit clippy` - :black_circle: `toolkit test` - :black_circle: `toolkit test stdlib` # After Submitting ``` $nothing ``` --- crates/nu-cli/src/prompt.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/nu-cli/src/prompt.rs b/crates/nu-cli/src/prompt.rs index 47357889ec..011c7512be 100644 --- a/crates/nu-cli/src/prompt.rs +++ b/crates/nu-cli/src/prompt.rs @@ -106,11 +106,13 @@ impl Prompt for NushellPrompt { prompt_string.replace('\n', "\r\n").into() } else { let default = DefaultPrompt::default(); - default + let prompt = default .render_prompt_left() .to_string() .replace('\n', "\r\n") - .into() + + " "; + + prompt.into() } }