Fix overeager pre-delayed-EOL wrapping in AdaptDispatch (#18899)

AdaptDispatch has a TODO item indicating that we should *not* consider a
row wrapped until we write into the cell beyond it. We actually do have
that logic (it even refers to it!), but we still set the wrap flag when
we fill the final column.

We never removed it because it broke the old VT rendering-based ConPTY
implementation.

Now that VtEngine is gone, so can be this code and this strange
workaround for a problem nobody was quite sure what was.

This will fix, hopefully, the last of our exact line length write wrap
issues. tmux users can finally rejoice.

Closes #8976
Closes #15602

(cherry picked from commit 14993db1cbd3f1bbe95f9a3fa0ab1dd1e565b2b7)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgaWx6A
Service-Version: 1.23
This commit is contained in:
Dustin L. Howett 2025-05-13 17:14:46 -07:00 committed by Dustin L. Howett
parent 9357281507
commit df34f34691

View File

@ -160,13 +160,6 @@ void AdaptDispatch::_WriteToBuffer(const std::wstring_view string)
}
const auto textPositionAfter = state.text.data();
// TODO: A row should not be marked as wrapped just because we wrote the last column.
// It should be marked whenever we write _past_ it (above, _DoLineFeed call). See GH#15602.
if (wrapAtEOL && state.columnEnd >= state.columnLimit)
{
textBuffer.SetWrapForced(cursorPosition.y, true);
}
if (state.columnBeginDirty != state.columnEndDirty)
{
const til::rect changedRect{ state.columnBeginDirty, cursorPosition.y, state.columnEndDirty, cursorPosition.y + 1 };