readline: avoid painting default prompt before prompt()#62525
Open
Tseian wants to merge 1 commit into
Open
Conversation
263b532 to
700207b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62525 +/- ##
==========================================
- Coverage 89.65% 89.52% -0.14%
==========================================
Files 712 712
Lines 220822 220699 -123
Branches 42373 42274 -99
==========================================
- Hits 197985 197572 -413
- Misses 14661 14929 +268
- Partials 8176 8198 +22
🚀 New features to boost your workflow:
|
Track whether prompt() has been invoked and whether the configured prompt is still the documented default. Until then, skip the default prefix when redrawing the line or computing cursor position, fixing inconsistent appearance after keys that refresh the line (see issue nodejs#12606). Set the same flag when tab completion redraws the line so behavior matches prior releases. Document that callers should call prompt() from a line listener when they want a prompt on each new line (REPL already does). Refs: nodejs#12606 Assisted-by: Cursor IDE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
#12606
Description
Track whether prompt() has been invoked and whether the configured prompt
is still the documented default. Until then, skip the default prefix when
redrawing the line or computing cursor position, fixing inconsistent
appearance after keys that refresh the line (see issue #12606).
Set the same flag when tab completion redraws the line so behavior matches
prior releases. Document that callers should call prompt() from a line
listener when they want a prompt on each new line (REPL already does).
Before
It does not use rl.prompt() anywhere and with a common input there will be no default prompt.
However, if a user press DELETE, BACKSPACE or UP button. For example default prompt immediately and somehow unexpectedly appears shifting the whole line when I click UP button.
a a > aAfter
Default prompt will not appear again.