Skip to content

Commit

Permalink
flush that too
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Apr 20, 2022
1 parent a9a8ef9 commit 3aad0f5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/host/outputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,17 @@ void ConhostInternalGetSet::NotifyAccessibilityChange(const til::rect& changedRe
}
}

void ConhostInternalGetSet::EndConptyFrame()
{
auto& g = ServiceLocator::LocateGlobals();
auto& gci = g.getConsoleInformation();

if (gci.IsInVtIoMode() && g.pRender)
{
g.pRender->TriggerFlush(false);
}
}

void ConhostInternalGetSet::ReparentWindow(const uint64_t handle)
{
// This will initialize s_interactivityFactory for us. It will also
Expand Down
2 changes: 2 additions & 0 deletions src/host/outputStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class ConhostInternalGetSet final : public Microsoft::Console::VirtualTerminal::

void NotifyAccessibilityChange(const til::rect& changedRect) override;

void EndConptyFrame() override;

void ReparentWindow(const uint64_t handle);

private:
Expand Down
7 changes: 6 additions & 1 deletion src/terminal/adapter/adaptDispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2336,7 +2336,12 @@ bool AdaptDispatch::DoConEmuAction(const std::wstring_view /*string*/) noexcept
// - false (so that the command gets flushed to terminal)
bool AdaptDispatch::DoITerm2Action(const std::wstring_view /*string*/) noexcept
{
// TODO! may need to flush manually, to make sure marks end up on the right line, like alt buffer sequence. Maybe.
// This is not implemented in conhost.

// Flush the frame manually, to make sure marks end up on the right line, like the alt buffer sequence.
_pConApi->EndConptyFrame();

// Return false to flush sequence unmodified to ConPTY (if applicable).
return false;
}

Expand Down
2 changes: 2 additions & 0 deletions src/terminal/adapter/conGetSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ namespace Microsoft::Console::VirtualTerminal

virtual void NotifyAccessibilityChange(const til::rect& changedRect) = 0;

virtual void EndConptyFrame() = 0;

virtual void ReparentWindow(const uint64_t handle) = 0;
};
}

1 comment on commit 3aad0f5

@github-actions

This comment was marked as outdated.

Please sign in to comment.