terminal/src/renderer
James Holderness bdbd1bd307
Prevent leftover cursor fragments when scrolling in PowerShell (#8173)
There are certain cursor movement operations (in conhost) that can
result in "ghost" cursor instances being left behind, if the move causes
the viewport to scroll while the cursor is blinking off. Pressing enter
in a PowerShell prompt when at the bottom of the screen was one example
of this. This PR fixes that problem.

Whenever the cursor renders with an `InvertRect`, the affected areas of
the screen are saved in the `cursorInvertRects` variable. If the screen
is then scrolled while the cursor is visible, those rects are
"uninverted" in the `GdiEngine::ScrollFrame` method before the scrolling
takes place.

When the cursor has blinked off, though, the `GdiEngine::PaintCursor`
method won't set the `cursorInvertRects` variable, but it also doesn't
clear it. So if the screen is scrolled at that point, the `ScrollFrame`
method tries to "uninvert" the area where the cursor had previously been
painted. And since the cursor is no longer there, this has the opposite
effect, leaving an unwanted mark on the screen.

I've fixed this by clearing the `cursorInvertRects` at the start of the
paint cycle, in the the `GdiEngine::PaintBackground` method. Since this
occurs after the `ScrollFrame` step, it still allows for legitimate
cursor instances to be cleaned up when scrolling, but makes sure that
the variable will be cleared for the next cycle if the cursor is no
longer visible.

## Validation Steps Performed

I've manually verified that I no longer see ghost cursor fragments when
scrolling in PowerShell.

Closes #804
2020-11-05 19:21:34 +00:00
..
base Make the link underline less obtrusive; don't use it for pattern (#8148) 2020-11-03 15:22:59 -08:00
dx Make the link underline less obtrusive; don't use it for pattern (#8148) 2020-11-03 15:22:59 -08:00
gdi Prevent leftover cursor fragments when scrolling in PowerShell (#8173) 2020-11-05 19:21:34 +00:00
inc Add support for autodetecting URLs and making hyperlinks (#7691) 2020-10-28 20:24:43 +00:00
uia Replace basic_string_view<T> with span<const T> (#6921) 2020-07-15 16:40:42 +00:00
vt Fix OSC8 termination over the PTY after SGR 0 (#7608) 2020-09-11 11:00:31 -07:00
wddmcon Merged PR 4963673: OS-side build fixes for 09471c375 (gsl-3.1.0 update) 2020-07-30 22:48:48 +00:00
dirs Merged PR 4645239: [Git2Git] Merged PR 4644345: conhost: disable the DX renderer in inbox builds 2020-05-05 23:03:07 +00:00