Skip to content

Hide placeholders after a prompt finishes - #2105

Open
x0Lazarus wants to merge 1 commit into
prompt-toolkit:mainfrom
x0Lazarus:fix/hide-placeholder-after-prompt
Open

x0Lazarus wants to merge 1 commit into
prompt-toolkit:mainfrom
x0Lazarus:fix/hide-placeholder-after-prompt

Conversation

@x0Lazarus

Copy link
Copy Markdown

Pressing Enter on an empty prompt leaves its placeholder on the completed line, so earlier prompts can look as though they are still waiting for input. Hide the placeholder during the final redraw, using the same is_done filter as other temporary prompt elements. It remains visible while the prompt is active, and submitted text is unchanged.

The regression tests inspect the rendered screens for plain and ANSI-formatted placeholders, with both empty and nonempty input. All four pass; the two empty-input cases fail before the change.

On Windows with Python 3.12, the full suite has 151 passing tests, five existing Windows skips and four failures also reproduced against unchanged source: two history tests and two tests requiring a Windows console. Ruff check/format, Typos and strict Mypy checks for all three configured platforms pass. Other operating systems and Python versions were not tested locally.

Fixes #1997.

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.

Prompt placeholder text should not remain in the terminal when we have entered no text.

1 participant