readline: avoid painting default prompt before prompt()#62525
Open
Tseian wants to merge 1 commit intonodejs:mainfrom
Open
readline: avoid painting default prompt before prompt()#62525Tseian wants to merge 1 commit intonodejs:mainfrom
Tseian wants to merge 1 commit intonodejs:mainfrom
Conversation
c006977 to
263b532
Compare
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
263b532 to
700207b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62525 +/- ##
==========================================
- Coverage 89.70% 89.55% -0.15%
==========================================
Files 694 706 +12
Lines 214216 218147 +3931
Branches 41108 41685 +577
==========================================
+ Hits 192160 195362 +3202
- Misses 14109 14683 +574
- Partials 7947 8102 +155
🚀 New features to boost your workflow:
|
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.