Skip to content

fix(painter): keep the right prompt through the exit erase - #1211

Merged
kronberger-droid merged 1 commit into
nushell:mainfrom
kronberger-droid:fix-right-prompt-erase
Sep 11, 2026
Merged

kronberger-droid merged 1 commit into
nushell:mainfrom
kronberger-droid:fix-right-prompt-erase

Conversation

@kronberger-droid

@kronberger-droid kronberger-droid commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fallout from #1145, which made the exit erase unconditional so a menu or a
hint could not survive into the recorded line. ClearType::FromCursorDown
also clears the cursor's own row to the right, which is where the right
prompt sits, and only after_cursor_lines was ever put back.

Narrowing the clear would undo #1145: the hint it exists to erase sits after
the cursor on the same row, exactly where the right prompt does. So the
erase stays and the right prompt is restored after it. Its color is captured
at paint time, since the caller sets the color around print_right_prompt
rather than inside it, and the exit has no prompt to ask.

No public API change; the new field is private to Painter.

Additional notes

fixes #1212

The unconditional erase from nushell#1145 also clears the cursor's own row to
the right, which is where the right prompt sits. Reported as
nushell/nushell#19001.

Narrowing the clear would undo nushell#1145: the hint it exists to erase sits
after the cursor on the same row, exactly where the right prompt does.
Thus the erase stays and the right prompt goes back afterwards.
@kronberger-droid
kronberger-droid marked this pull request as ready for review September 10, 2026 23:20
@kronberger-droid
kronberger-droid merged commit d5af1d1 into nushell:main Sep 11, 2026
7 checks passed
@kronberger-droid
kronberger-droid deleted the fix-right-prompt-erase branch September 11, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

$env.TRANSIENT_PROMPT_COMMAND_RIGHT = null no longer works

1 participant