This doesn't seem to flash in debug anymore. Lemme double-check release and be sure.

This commit is contained in:
Mike Griese
2023-01-11 14:05:13 -06:00
parent 21a62c5fef
commit ba777dfbf6
7 changed files with 34 additions and 7 deletions

View File

@@ -234,6 +234,8 @@ class TerminalCoreUnitTests::ConptyRoundtripTests final
TEST_METHOD(TestNoExtendedAttrsOptimization);
TEST_METHOD(TestNoBackgroundAttrsOptimization);
TEST_METHOD(TestShellIntegrationFlickering);
private:
bool _writeCallback(const char* const pch, const size_t cch);
void _flushFirstFrame();

View File

@@ -2349,7 +2349,10 @@ void SCREEN_INFORMATION::SetTerminalConnection(_In_ VtEngine* const pTtyConnecti
if (pTtyConnection)
{
engine.SetTerminalConnection(pTtyConnection,
std::bind(&StateMachine::FlushToTerminal, _stateMachine.get()));
[this]() -> bool {
ServiceLocator::LocateGlobals().pRender->NotifyPaintFrame();
return _stateMachine->FlushToTerminal();
});
}
else
{

View File

@@ -537,7 +537,7 @@ CATCH_RETURN();
// To fix this, flush here, so this string is sent to the connected terminal
// application.
return _Flush();
return S_OK; // _Flush();
}
// Method Description:

View File

@@ -120,6 +120,12 @@ CATCH_RETURN();
_circled = circled;
}
// If we flushed for any reason other than circling, we don't need to push
// the buffer out on EndPaint. We're doing this because we encountered some
// VT sequence that required we sync the state of the buffers before passing
// it through.
_noFlushOnEnd = !circled;
_trace.TraceTriggerCircling(*pForcePaint);
return S_OK;

View File

@@ -43,6 +43,12 @@ using namespace Microsoft::Console::Types;
_cursorMoved,
_wrappedRow);
//if (_buffer.size() > 0 && _quickReturn)
//{
// RETURN_IF_FAILED(_Flush());
// return S_FALSE;
//}
return _quickReturn ? S_FALSE : S_OK;
}
@@ -94,7 +100,14 @@ using namespace Microsoft::Console::Types;
RETURN_IF_FAILED(_MoveCursor(_deferredCursorPos));
}
RETURN_IF_FAILED(_Flush());
if (_noFlushOnEnd)
{
_noFlushOnEnd = false;
}
else
{
RETURN_IF_FAILED(_Flush());
}
return S_OK;
}
@@ -538,10 +551,11 @@ using namespace Microsoft::Console::Types;
// Write the actual text string. If we're using a soft font, the character
// set should have already been selected, so we just need to map our internal
// representation back to ASCII (handled by the _WriteTerminalDrcs method).
if (_usingSoftFont) [[unlikely]]
{
RETURN_IF_FAILED(VtEngine::_WriteTerminalDrcs({ _bufferLine.data(), cchActual }));
}
if (_usingSoftFont)
[[unlikely]]
{
RETURN_IF_FAILED(VtEngine::_WriteTerminalDrcs({ _bufferLine.data(), cchActual }));
}
else
{
RETURN_IF_FAILED(VtEngine::_WriteTerminalUtf8({ _bufferLine.data(), cchActual }));

View File

@@ -139,6 +139,7 @@ namespace Microsoft::Console::Render
bool _resizeQuirk{ false };
bool _passthrough{ false };
bool _noFlushOnEnd{ false };
std::optional<TextColor> _newBottomLineBG{ std::nullopt };
[[nodiscard]] HRESULT _WriteFill(const size_t n, const char c) noexcept;

View File

@@ -168,6 +168,7 @@ bool OutputStateMachineEngine::ActionPassThroughString(const std::wstring_view s
if (_pTtyConnection != nullptr)
{
const auto hr = _pTtyConnection->WriteTerminalW(string);
LOG_IF_FAILED(hr);
success = SUCCEEDED(hr);
}