terminal/src/renderer/vt
Mike Griese 6fabc4abb7
Fix copying wrapped lines by implementing better scrolling (#5181)
Now that the Terminal is doing a better job of actually marking which
lines were and were not wrapped, we're not always copying lines as
"wrapped" when they should be. We're more correctly marking lines as not
wrapped, when previously we'd leave them marked wrapped.

The real problem is here in the `ScrollFrame` method - we'd manually
newline the cursor to make the terminal's viewport shift down to a new
line. If we had to scroll the viewport for a _wrapped_ line, this would
cause the Terminal to mark that line as broken, because conpty would
emit an extra `\n` that didn't actually exist.

This more correctly implements `ScrollFrame`. Now, well move where we
"thought" the cursor was, so when we get to the next `PaintBufferLine`,
if the cursor needs to newline for the next line, it'll newline, but if
we're in the middle of a wrapped line, we'll just keep printing the
wrapped line.

A couple follow up bugs were found to be caused by the same bad logic.
See #5039 and #5161 for more details on the investigations there.

## References

* #4741 RwR, which probably made this worse
* #5122, which I branched off of 
* #1245, #357 - a pair of other conpty wrapped lines bugs
* #5228 - A followup issue for this PR

## PR Checklist
* [x] Closes #5113
* [x] Closes #5180 (by fixing DECRST 25)
* [x] Closes #5039
* [x] Closes #5161 (by ensuring we only `removeSpaces` on the actual
  bottom line)
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed

* Checked the cases from #1245, #357 to validate that they still work
* Added more and more tests for these scenarios, and then I added MORE
  tests
* The entire team played with this in selfhost builds
2020-04-09 00:06:25 +00:00
..
lib Unify and clean up the common build properties (#3429) 2019-11-05 14:29:11 -08:00
ut_lib Merged PR 4465022: [Git2Git] Merged PR 4464559: Console: Ingest OSS changes up to e0550798 2020-03-26 01:20:36 +00:00
dirs Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
invalidate.cpp Correct scrolling invalidation region for tmux in pty w/ bitmap (#5122) 2020-03-27 22:37:23 +00:00
math.cpp Correct scrolling invalidation region for tmux in pty w/ bitmap (#5122) 2020-03-27 22:37:23 +00:00
paint.cpp Fix copying wrapped lines by implementing better scrolling (#5181) 2020-04-09 00:06:25 +00:00
precomp.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
precomp.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
sources.inc inbox: reflect incoming changes from Windows 2019-05-14 16:16:43 -07:00
state.cpp Fix copying wrapped lines by implementing better scrolling (#5181) 2020-04-09 00:06:25 +00:00
tracing.cpp Fix copying wrapped lines by implementing better scrolling (#5181) 2020-04-09 00:06:25 +00:00
tracing.hpp Fix copying wrapped lines by implementing better scrolling (#5181) 2020-04-09 00:06:25 +00:00
vt-renderer-common.vcxitems Unify and clean up the common build properties (#3429) 2019-11-05 14:29:11 -08:00
vtrenderer.hpp Fix copying wrapped lines by implementing better scrolling (#5181) 2020-04-09 00:06:25 +00:00
VtSequences.cpp Use estimated formatted lengths to optimize performance of VT rendering (#4890) 2020-03-11 22:12:25 +00:00
WinTelnetEngine.cpp When Conpty encounters an unknown string, flush immediately (#4896) 2020-03-12 16:31:45 -07:00
WinTelnetEngine.hpp Make the terminal parser/adapter and related classes use modern… (#3956) 2019-12-19 14:12:53 -08:00
Xterm256Engine.cpp Revert locking changes (#3488) 2019-11-08 13:44:52 -08:00
Xterm256Engine.hpp Create tests that roundtrip output through a conpty to a Terminal (#4213) 2020-01-17 16:40:12 +00:00
XtermEngine.cpp Fix copying wrapped lines by implementing better scrolling (#5181) 2020-04-09 00:06:25 +00:00
XtermEngine.hpp Make Conpty emit wrapped lines as actually wrapped lines (#4415) 2020-02-27 16:40:11 +00:00