Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flush Warp OSC. #1

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/terminal/adapter/ITermDispatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ class Microsoft::Console::VirtualTerminal::ITermDispatch

virtual bool DoVsCodeAction(const std::wstring_view string) = 0;

virtual bool DoWarpAction(const std::wstring_view string) = 0;

virtual StringHandler DownloadDRCS(const VTInt fontNumber,
const VTParameter startChar,
const DispatchTypes::DrcsEraseControl eraseControl,
Expand Down
14 changes: 14 additions & 0 deletions src/terminal/adapter/adaptDispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3756,6 +3756,20 @@ bool AdaptDispatch::DoConEmuAction(const std::wstring_view string)
return false;
}

// Method Description:
// - Performs a Warp Action
// -
bool AdaptDispatch::DoWarpAction(const std::wstring_view)
{
const auto isConPty = _api.IsConsolePty();
if (isConPty) {
// Flush the frame manually, to make sure marks end up on the right
// line, like the alt buffer sequence.
_renderer.TriggerFlush(false);
}
return false;
}

// Method Description:
// - Performs a iTerm2 action
// - Ascribes to the ITermDispatch interface
Expand Down
2 changes: 2 additions & 0 deletions src/terminal/adapter/adaptDispatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ namespace Microsoft::Console::VirtualTerminal

bool DoVsCodeAction(const std::wstring_view string) override;

bool DoWarpAction(const std::wstring_view string) override;

StringHandler DownloadDRCS(const VTInt fontNumber,
const VTParameter startChar,
const DispatchTypes::DrcsEraseControl eraseControl,
Expand Down
2 changes: 2 additions & 0 deletions src/terminal/adapter/termDispatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ class Microsoft::Console::VirtualTerminal::TermDispatch : public Microsoft::Cons

bool DoVsCodeAction(const std::wstring_view /*string*/) override { return false; }

bool DoWarpAction(const std::wstring_view /*string*/) override { return false; }

StringHandler DownloadDRCS(const VTInt /*fontNumber*/,
const VTParameter /*startChar*/,
const DispatchTypes::DrcsEraseControl /*eraseControl*/,
Expand Down
5 changes: 5 additions & 0 deletions src/terminal/parser/OutputStateMachineEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,11 @@ bool OutputStateMachineEngine::ActionOscDispatch(const size_t parameter, const s
success = _dispatch->DoVsCodeAction(string);
break;
}
case OscActionCodes::WarpAction:
{
success = _dispatch->DoWarpAction(string);
break;
}
default:
// If no functions to call, overall dispatch was a failure.
success = false;
Expand Down
1 change: 1 addition & 0 deletions src/terminal/parser/OutputStateMachineEngine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ namespace Microsoft::Console::VirtualTerminal
FinalTermAction = 133,
VsCodeAction = 633,
ITerm2Action = 1337,
WarpAction = 9278,
};

bool _GetOscSetColorTable(const std::wstring_view string,
Expand Down