Skip to content

Commit

Permalink
This all wroks far to shockingly well
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Mar 26, 2020
1 parent b94cfdb commit e21101b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ void ConptyRoundtripTests::OutputWrappedLinesAtBottomOfBuffer()
const auto wrappedLineLength = TerminalViewWidth + 20;

expectedOutput.push_back(std::string(TerminalViewWidth, 'A'));
expectedOutput.push_back("\x1b[32;80H"); // If a future change removes the need for this, it wouldn't be the worst.
// expectedOutput.push_back("\x1b[32;80H"); // If a future change removes the need for this, it wouldn't be the worst.
expectedOutput.push_back(std::string(20, 'A'));

hostSm.ProcessString(std::wstring(wrappedLineLength, L'A'));
Expand Down
2 changes: 1 addition & 1 deletion src/host/ut_host/ConptyOutputTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ void ConptyOutputTests::InvalidateUntilOneBeforeEnd()

expectedOutput.push_back("\x1b[65C");
expectedOutput.push_back("ABCDEFGHIJKLMNO");
expectedOutput.push_back("\x1b[1;80H"); // we move the cursor to the end of the line after paint
// expectedOutput.push_back("\x1b[1;80H"); // we move the cursor to the end of the line after paint

VERIFY_SUCCEEDED(renderer.PaintFrame());

Expand Down
41 changes: 29 additions & 12 deletions src/renderer/vt/XtermEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,20 +215,37 @@ XtermEngine::XtermEngine(_In_ wil::unique_hfile hPipe,
// StartPaint)
_nextCursorIsVisible = true;

const auto stashedEOLWrap = _delayedEolWrap;
const auto stashedWappedRow = _wrappedRow;
const auto result = VtEngine::PaintCursor(options);
_delayedEolWrap = stashedEOLWrap;
_wrappedRow = stashedWappedRow;
if (_wrappedRow.has_value())
{
_trace.TraceSetWrapped(_wrappedRow.value());
}
else
// {
// // Method.2
// const auto stashedEOLWrap = _delayedEolWrap;
// const auto stashedWappedRow = _wrappedRow;
// const auto result = VtEngine::PaintCursor(options);
// _delayedEolWrap = stashedEOLWrap;
// _wrappedRow = stashedWappedRow;
// if (_wrappedRow.has_value())
// {
// _trace.TraceSetWrapped(_wrappedRow.value());
// }
// else
// {
// _trace.TraceClearWrapped();
// }
// return result;

// }

{
_trace.TraceClearWrapped();
// Method.3
if (_delayedEolWrap && _wrappedRow.has_value())
{
}
else
{
return VtEngine::PaintCursor(options);
}

return S_OK;
}
return result;
}

// Routine Description:
Expand Down

0 comments on commit e21101b

Please sign in to comment.