correctly presenting progressbar when buffer scrolls and clearing at end#3362
correctly presenting progressbar when buffer scrolls and clearing at end#3362lzybkr merged 1 commit intoPowerShell:masterfrom
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.
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.
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:
