-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the prompt sometimes not being erased properly (#15880)
A carriage return (enter key) will increase the _distanceEnd by up to viewport-width many columns, since it increases the Y distance between the start and end by 1 (it's a newline after all). This will make _flushBuffer() think that the new _buffer is way longer than the old one and so _erase() ends up not erasing the tail end of the prompt, even if the new prompt is actually shorter. This commit fixes the issue by separating the newline printing out from the regular text printing loops. ## Validation Steps Performed * Run cmd.exe * Write "echo hello" and press Enter * Write "foobar foo bar" (don't press Enter) * Press F7, select "echo hello" and press Enter * Previous prompt says "echo hello" ✅
- Loading branch information
Showing
2 changed files
with
103 additions
and
68 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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