diff --git a/src/terminal/adapter/ITermDispatch.hpp b/src/terminal/adapter/ITermDispatch.hpp index 7b8cf9d7a57..89995757f47 100644 --- a/src/terminal/adapter/ITermDispatch.hpp +++ b/src/terminal/adapter/ITermDispatch.hpp @@ -136,6 +136,7 @@ class Microsoft::Console::VirtualTerminal::ITermDispatch virtual bool DoITerm2Action(const std::wstring_view string) = 0; virtual bool DoFinalTermAction(const std::wstring_view string) = 0; + virtual bool DoXtermJsAction(const std::wstring_view string) = 0; virtual StringHandler DownloadDRCS(const VTInt fontNumber, const VTParameter startChar, diff --git a/src/terminal/adapter/adaptDispatch.cpp b/src/terminal/adapter/adaptDispatch.cpp index 16aa57f6d83..41901151b32 100644 --- a/src/terminal/adapter/adaptDispatch.cpp +++ b/src/terminal/adapter/adaptDispatch.cpp @@ -3729,6 +3729,13 @@ bool AdaptDispatch::DoFinalTermAction(const std::wstring_view string) return false; } +// We literally only implement the xterm.js sequences that are aliases for the +// final term ones. Just implement exactly the same. +bool AdaptDispatch::DoXtermJsAction(const std::wstring_view string) +{ + return DoFinalTermAction(string); +} + // Method Description: // - DECDLD - Downloads one or more characters of a dynamically redefinable // character set (DRCS) with a specified pixel pattern. The pixel array is diff --git a/src/terminal/adapter/adaptDispatch.hpp b/src/terminal/adapter/adaptDispatch.hpp index e0c346dc9d0..8605a623538 100644 --- a/src/terminal/adapter/adaptDispatch.hpp +++ b/src/terminal/adapter/adaptDispatch.hpp @@ -138,6 +138,7 @@ namespace Microsoft::Console::VirtualTerminal bool DoITerm2Action(const std::wstring_view string) override; bool DoFinalTermAction(const std::wstring_view string) override; + bool DoXtermJsAction(const std::wstring_view string) override; StringHandler DownloadDRCS(const VTInt fontNumber, const VTParameter startChar, diff --git a/src/terminal/adapter/termDispatch.hpp b/src/terminal/adapter/termDispatch.hpp index 2fe1f216a3d..7d8469bca14 100644 --- a/src/terminal/adapter/termDispatch.hpp +++ b/src/terminal/adapter/termDispatch.hpp @@ -129,6 +129,7 @@ class Microsoft::Console::VirtualTerminal::TermDispatch : public Microsoft::Cons bool DoITerm2Action(const std::wstring_view /*string*/) override { return false; } bool DoFinalTermAction(const std::wstring_view /*string*/) override { return false; } + bool DoXtermJsAction(const std::wstring_view /*string*/) override { return false; } StringHandler DownloadDRCS(const VTInt /*fontNumber*/, const VTParameter /*startChar*/, diff --git a/src/terminal/parser/OutputStateMachineEngine.cpp b/src/terminal/parser/OutputStateMachineEngine.cpp index 80a77d89173..ebbf8e405d8 100644 --- a/src/terminal/parser/OutputStateMachineEngine.cpp +++ b/src/terminal/parser/OutputStateMachineEngine.cpp @@ -417,7 +417,8 @@ bool OutputStateMachineEngine::ActionVt52EscDispatch(const VTID id, const VTPara bool OutputStateMachineEngine::ActionCsiDispatch(const VTID id, const VTParameters parameters) { // Bail out if we receive subparameters, but we don't accept them in the sequence. - if (parameters.hasSubParams() && !_CanSeqAcceptSubParam(id, parameters)) [[unlikely]] + if (parameters.hasSubParams() && !_CanSeqAcceptSubParam(id, parameters)) + [[unlikely]] { return false; } @@ -868,6 +869,11 @@ bool OutputStateMachineEngine::ActionOscDispatch(const wchar_t /*wch*/, success = _dispatch->DoFinalTermAction(string); break; } + case OscActionCodes::XtermJsAction: + { + success = _dispatch->DoXtermJsAction(string); + break; + } default: // If no functions to call, overall dispatch was a failure. success = false; diff --git a/src/terminal/parser/OutputStateMachineEngine.hpp b/src/terminal/parser/OutputStateMachineEngine.hpp index b078ade9fb7..d79b139c188 100644 --- a/src/terminal/parser/OutputStateMachineEngine.hpp +++ b/src/terminal/parser/OutputStateMachineEngine.hpp @@ -214,6 +214,7 @@ namespace Microsoft::Console::VirtualTerminal ResetBackgroundColor = 111, // Not implemented ResetCursorColor = 112, FinalTermAction = 133, + XtermJsAction = 633, ITerm2Action = 1337, };