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
This commit is contained in:
Dustin L. Howett 2025-05-13 17:14:46 -07:00 committed by GitHub
parent 696dac2c6a
commit 14993db1cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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 };