nushell icon indicating copy to clipboard operation
nushell copied to clipboard

Prompt rendering 2 times if prompt contains newline, when first starting nushell and pressing a key

Open maxomatic458 opened this issue 1 year ago • 2 comments

Describe the bug

i noticed this when using the starship prompt with nushell that has a similar config to this:

$env.PROMPT_INDICATOR = ""
$env.PROMPT_COMMAND = {|| ( echo "test\n>" )}

(the rest of my config is pretty much default)

now, when i open nushell and i press any key, the prompt will be rendered again

a very weird thing i noticed with windows terminal is that i can create a new tab, and then this will not happen (see clip).

How to reproduce

  1. use the values above in config.nu
  2. open nushell and type something
  3. the prompt should be rendered 2 times

Expected behavior

the prompt should not be redrawn

Screenshots

https://github.com/nushell/nushell/assets/104733404/1dc2f73d-2986-4db4-b87d-7a166e95764a

Configuration

key value
version 0.89.1
branch main
commit_hash 9ee8d746588d848d841ed4e0dbcce8b8874a01d5
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.73.0 (cc66ad468 2023-10-03)
rust_channel 1.73.0-x86_64-pc-windows-msvc
cargo_version cargo 1.73.0 (9c4383fb5 2023-08-26)
build_time 2024-01-21 14:03:27 +01:00
build_rust_channel release
allocator mimalloc
features default, sqlite, trash, which, zip
installed_plugins

Additional context

No response

maxomatic458 avatar Jan 23 '24 22:01 maxomatic458

it would be great to fix this double render.

fdncred avatar Jan 26 '24 12:01 fdncred

I have the same issue.

stephenstubbs avatar Aug 25 '24 11:08 stephenstubbs