-
Notifications
You must be signed in to change notification settings - Fork 7.6k
correctly presenting progressbar when buffer scrolls and clearing at end #3362
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
Conversation
if (_location.Y >= _rawui.BufferSize.Height - rows) | ||
//if the cursor is at the bottom, create screen buffer space by scrolling | ||
int scrollRows = rows - ((_rawui.BufferSize.Height - 1) - _location.Y); | ||
for (int i = 0; i < rows; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In rare cases, there may be junk on the screen below the prompt. Maybe we should be writing out spaces to make sure it's clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's junk, it'll get overwritten anyways with tempProgressRegion
where every cell has a character including spaces
We can try to use our TestHostCS.psm1 |
@iSazonov don't think TestHostCS.psm1 will help here since we're trying to validate how powershell.exe handles progressbar |
Testing this would be similar to how I test PSReadline - I introduce a mock console interface, so instead of It's a pain to write these tests and there is little return in that investment, so that's why I didn't ask Steve for any tests. |
If the stock price change, I may try to enhance our TestHostCS.psm1 to support this scenarios. 😄 |
Windows progressbar requires ability to cache the screen buffer contents so it can write it back once progress is done. Linux doesn't provide a way for console apps to read the screen buffer (security concern). Changes:
No easy way to add tests for ProgressBar.
addresses #1625
Before the change:

After the change:
