Skip to content

Fix the regression to make long lines works properly at the end of screen buffer. #895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2019

Conversation

daxian-dbw
Copy link
Member

Fix #884

There are mainly two changes:

  1. when clearing characters from previous physical lines, use _console.SetCursorPosition(0, _initialY + physicalLine) to move to the next line instead of Write("\n").
    this is because when the previous physical line is at the bottom of buffer height, _console.Write("\n") will scroll up the buffer and screw up the existing physical lines.
  2. when the cursor top exceeds the buffer height, call _console.Write("\n") to scroll up the buffer, and adjust _initialY and point.Y accordingly.

This is the behavior after this fix:

test

@daxian-dbw daxian-dbw requested a review from lzybkr April 16, 2019 23:58
@daxian-dbw daxian-dbw merged commit ef2f65f into PowerShell:master Apr 17, 2019
@daxian-dbw daxian-dbw deleted the fix branch April 17, 2019 01:47
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.

Long lines at the end of the buffer cause an exception
2 participants