Position the conpty cursor correctly when wrappedRow is set #17290
+58
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
If the VT render engine is moving the cursor to the start of a row, and
the previous row was marked as wrapped, it will assume that it doesn't
need to do anything, because the next output should automatically move
the cursor to the correct position anyway.
However, if that cursor movement is coming from the final
PaintCursor
call for the frame, there isn't going to be any more output, so the
cursor will be left in the wrong position.
This PR fixes that issue by clearing the
_wrappedRow
field before the_MoveCursor
call in thePaintCursor
method.Validation Steps Performed
I've confirmed that this fixes all the test cases mentioned in issue
#17270, and issue #17013, and I've added a unit test to check the new
behavior is working as expected.
However, this change does break a couple of
ConptyRoundtripTests
thatwere expecting the terminal row to be marked as wrapped when writing a
wrapped line in two parts using
WriteCharsLegacy
. This is because thelegacy way of wrapping a line isn't the same as a VT delayed wrap, so it
has to be emulated with cursor movement, and that can end up resetting
the wrap flag.
It's possible that could be fixed, but it's already broken in a number
of other ways, so I don't think this makes things much worse. For now,
I've just made the affected test cases skip the wrapping check.
PR Checklist