nushell / nushell/nushell

Multiline promtps override previous line when exiting Neovim

Open
#12,104 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A:line-editor category:bug status:needs-triage
Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 19h
Merged PRs (30d)
85

Description

Describe the bug

When extitng Neovim, if the custom prompt returned is more than 1 line, the last line of the new prompt is overriden, then recreating the prompt.

How to reproduce
  1. Set the prompt function to return a multi-line prompt: $env.PROMPT_COMMAND = {|| "nushell\n--" }
  2. Restart nushell
  3. Open neovim and exit
  4. Start typing a new command (eg. nvim)
Expected behavior

A prompt is not skipped, and the last line is not deleted/overridden.

Screenshots

image

Configuration
key value
version 0.90.1
branch
commit_hash c2992d5d8b8541b64e9fc1440ed2917fc9b757f7
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-02-07 02:25:09 +00:00
build_rust_channel release
allocator mimalloc
features default, sqlite, trash, which, zip
installed_plugins
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the multiline prompt case on Windows with the provided PROMPT_COMMAND, then trace prompt rendering around opening and exiting Neovim. Check how the prompt is recreated after the editor exits and add coverage for a prompt containing a newline. Done means the prompt is not skipped and its final line is not overwritten when typing the next command.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.