From 596597bca384cf0883dd8b597cdaee41be70110e Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Mon, 26 Oct 2020 19:38:10 -0700 Subject: [PATCH] Revert "Add support for the DECREQTPARM report (#7939)" This reverts commit 74678ff2b0d2439d6ecdbe3da5e83e7bb4eaf33e. --- .github/actions/spell-check/expect/expect.txt | 1 - src/terminal/adapter/DispatchTypes.hpp | 6 --- src/terminal/adapter/ITermDispatch.hpp | 1 - src/terminal/adapter/adaptDispatch.cpp | 34 ------------- src/terminal/adapter/adaptDispatch.hpp | 1 - src/terminal/adapter/termDispatch.hpp | 1 - .../adapter/ut_adapter/adapterTest.cpp | 24 --------- .../parser/OutputStateMachineEngine.cpp | 4 -- .../parser/OutputStateMachineEngine.hpp | 1 - src/terminal/parser/telemetry.cpp | 1 - src/terminal/parser/telemetry.hpp | 1 - .../parser/ut_parser/OutputEngineTest.cpp | 50 ------------------- 12 files changed, 125 deletions(-) diff --git a/.github/actions/spell-check/expect/expect.txt b/.github/actions/spell-check/expect/expect.txt index 92d3e3f91f4..8e59251ffdc 100644 --- a/.github/actions/spell-check/expect/expect.txt +++ b/.github/actions/spell-check/expect/expect.txt @@ -537,7 +537,6 @@ DECOM deconstructed DECPCTERM DECRC -DECREQTPARM DECRLM DECRQM DECRST diff --git a/src/terminal/adapter/DispatchTypes.hpp b/src/terminal/adapter/DispatchTypes.hpp index dc46d5c6c97..6266ce6784e 100644 --- a/src/terminal/adapter/DispatchTypes.hpp +++ b/src/terminal/adapter/DispatchTypes.hpp @@ -226,12 +226,6 @@ namespace Microsoft::Console::VirtualTerminal::DispatchTypes SteadyBar = 6 }; - enum class ReportingPermission : size_t - { - Unsolicited = 0, - Solicited = 1 - }; - enum class LineFeedType : unsigned int { WithReturn, diff --git a/src/terminal/adapter/ITermDispatch.hpp b/src/terminal/adapter/ITermDispatch.hpp index 9350dcae76a..60639e67c3d 100644 --- a/src/terminal/adapter/ITermDispatch.hpp +++ b/src/terminal/adapter/ITermDispatch.hpp @@ -97,7 +97,6 @@ class Microsoft::Console::VirtualTerminal::ITermDispatch virtual bool SecondaryDeviceAttributes() = 0; // DA2 virtual bool TertiaryDeviceAttributes() = 0; // DA3 virtual bool Vt52DeviceAttributes() = 0; // VT52 Identify - virtual bool RequestTerminalParameters(const DispatchTypes::ReportingPermission permission) = 0; // DECREQTPARM virtual bool DesignateCodingSystem(const VTID codingSystem) = 0; // DOCS virtual bool Designate94Charset(const size_t gsetNumber, const VTID charset) = 0; // SCS diff --git a/src/terminal/adapter/adaptDispatch.cpp b/src/terminal/adapter/adaptDispatch.cpp index c562987be4f..a3e1342151e 100644 --- a/src/terminal/adapter/adaptDispatch.cpp +++ b/src/terminal/adapter/adaptDispatch.cpp @@ -769,40 +769,6 @@ bool AdaptDispatch::Vt52DeviceAttributes() return _WriteResponse(L"\x1b/Z"); } -// Routine Description: -// - DECREQTPARM - This sequence was originally used on the VT100 terminal to -// report the serial communication parameters (baud rate, data bits, parity, -// etc.). On modern terminal emulators, the response is simply hardcoded. -// Arguments: -// - permission - This would originally have determined whether the terminal -// was allowed to send unsolicited reports or not. -// Return Value: -// - True if handled successfully. False otherwise. -bool AdaptDispatch::RequestTerminalParameters(const DispatchTypes::ReportingPermission permission) -{ - // We don't care whether unsolicited reports are allowed or not, but the - // requested permission does determine the value of the first response - // parameter. The remaining parameters are just hardcoded to indicate a - // 38400 baud connection, which matches the XTerm response. The full - // parameter sequence is as follows: - // - response type: 2 or 3 (unsolicited or solicited) - // - parity: 1 (no parity) - // - data bits: 1 (8 bits per character) - // - transmit speed: 128 (38400 baud) - // - receive speed: 128 (38400 baud) - // - clock multiplier: 1 - // - flags: 0 - switch (permission) - { - case DispatchTypes::ReportingPermission::Unsolicited: - return _WriteResponse(L"\x1b[2;1;1;128;128;1;0x"); - case DispatchTypes::ReportingPermission::Solicited: - return _WriteResponse(L"\x1b[3;1;1;128;128;1;0x"); - default: - return false; - } -} - // Routine Description: // - DSR-OS - Reports the operating status back to the input channel // Arguments: diff --git a/src/terminal/adapter/adaptDispatch.hpp b/src/terminal/adapter/adaptDispatch.hpp index 8a084447b9b..1d893e61ef8 100644 --- a/src/terminal/adapter/adaptDispatch.hpp +++ b/src/terminal/adapter/adaptDispatch.hpp @@ -61,7 +61,6 @@ namespace Microsoft::Console::VirtualTerminal bool SecondaryDeviceAttributes() override; // DA2 bool TertiaryDeviceAttributes() override; // DA3 bool Vt52DeviceAttributes() override; // VT52 Identify - bool RequestTerminalParameters(const DispatchTypes::ReportingPermission permission) override; // DECREQTPARM bool ScrollUp(const size_t distance) override; // SU bool ScrollDown(const size_t distance) override; // SD bool InsertLine(const size_t distance) override; // IL diff --git a/src/terminal/adapter/termDispatch.hpp b/src/terminal/adapter/termDispatch.hpp index 3bb6242dc94..31070f85623 100644 --- a/src/terminal/adapter/termDispatch.hpp +++ b/src/terminal/adapter/termDispatch.hpp @@ -91,7 +91,6 @@ class Microsoft::Console::VirtualTerminal::TermDispatch : public Microsoft::Cons bool SecondaryDeviceAttributes() noexcept override { return false; } // DA2 bool TertiaryDeviceAttributes() noexcept override { return false; } // DA3 bool Vt52DeviceAttributes() noexcept override { return false; } // VT52 Identify - bool RequestTerminalParameters(const DispatchTypes::ReportingPermission /*permission*/) noexcept override { return false; } // DECREQTPARM bool DesignateCodingSystem(const VTID /*codingSystem*/) noexcept override { return false; } // DOCS bool Designate94Charset(const size_t /*gsetNumber*/, const VTID /*charset*/) noexcept override { return false; } // SCS diff --git a/src/terminal/adapter/ut_adapter/adapterTest.cpp b/src/terminal/adapter/ut_adapter/adapterTest.cpp index 531ed60a7f2..c3693a6e6e6 100644 --- a/src/terminal/adapter/ut_adapter/adapterTest.cpp +++ b/src/terminal/adapter/ut_adapter/adapterTest.cpp @@ -1823,30 +1823,6 @@ class AdapterTest VERIFY_IS_FALSE(_pDispatch.get()->TertiaryDeviceAttributes()); } - TEST_METHOD(RequestTerminalParametersTests) - { - Log::Comment(L"Starting test..."); - - Log::Comment(L"Test 1: Verify response for unsolicited permission."); - _testGetSet->PrepData(); - VERIFY_IS_TRUE(_pDispatch.get()->RequestTerminalParameters(DispatchTypes::ReportingPermission::Unsolicited)); - _testGetSet->ValidateInputEvent(L"\x1b[2;1;1;128;128;1;0x"); - - Log::Comment(L"Test 2: Verify response for solicited permission."); - _testGetSet->PrepData(); - VERIFY_IS_TRUE(_pDispatch.get()->RequestTerminalParameters(DispatchTypes::ReportingPermission::Solicited)); - _testGetSet->ValidateInputEvent(L"\x1b[3;1;1;128;128;1;0x"); - - Log::Comment(L"Test 3: Verify failure with invalid parameter."); - _testGetSet->PrepData(); - VERIFY_IS_FALSE(_pDispatch.get()->RequestTerminalParameters((DispatchTypes::ReportingPermission)2)); - - Log::Comment(L"Test 4: Verify failure when WriteConsoleInput doesn't work."); - _testGetSet->PrepData(); - _testGetSet->_privateWriteConsoleInputWResult = FALSE; - VERIFY_IS_FALSE(_pDispatch.get()->RequestTerminalParameters(DispatchTypes::ReportingPermission::Unsolicited)); - } - TEST_METHOD(CursorKeysModeTest) { Log::Comment(L"Starting test..."); diff --git a/src/terminal/parser/OutputStateMachineEngine.cpp b/src/terminal/parser/OutputStateMachineEngine.cpp index 3a3841db0f4..15e946602fa 100644 --- a/src/terminal/parser/OutputStateMachineEngine.cpp +++ b/src/terminal/parser/OutputStateMachineEngine.cpp @@ -469,10 +469,6 @@ bool OutputStateMachineEngine::ActionCsiDispatch(const VTID id, gsl::spanRequestTerminalParameters(parameters.at(0)); - TermTelemetry::Instance().Log(TermTelemetry::Codes::DECREQTPARM); - break; case CsiActionCodes::SU_ScrollUp: case CsiActionCodes::SD_ScrollDown: success = _GetScrollDistance(parameters, distance); diff --git a/src/terminal/parser/OutputStateMachineEngine.hpp b/src/terminal/parser/OutputStateMachineEngine.hpp index cb31585f4eb..794a9d59f9e 100644 --- a/src/terminal/parser/OutputStateMachineEngine.hpp +++ b/src/terminal/parser/OutputStateMachineEngine.hpp @@ -129,7 +129,6 @@ namespace Microsoft::Console::VirtualTerminal ANSISYSSC_CursorSave = VTID("s"), // NOTE: Overlaps with DECLRMM/DECSLRM. Fix when/if implemented. DTTERM_WindowManipulation = VTID("t"), // NOTE: Overlaps with DECSLPP. Fix when/if implemented. ANSISYSRC_CursorRestore = VTID("u"), - DECREQTPARM_RequestTerminalParameters = VTID("x"), DECSCUSR_SetCursorStyle = VTID(" q"), DECSTR_SoftReset = VTID("!p"), DECSCPP_SetColumnsPerPage = VTID("$|") diff --git a/src/terminal/parser/telemetry.cpp b/src/terminal/parser/telemetry.cpp index 445b1e1d3fd..e7433301c4e 100644 --- a/src/terminal/parser/telemetry.cpp +++ b/src/terminal/parser/telemetry.cpp @@ -227,7 +227,6 @@ void TermTelemetry::WriteFinalTraceLog() const TraceLoggingUInt32(_uiTimesUsed[DA], "DA"), TraceLoggingUInt32(_uiTimesUsed[DA2], "DA2"), TraceLoggingUInt32(_uiTimesUsed[DA3], "DA3"), - TraceLoggingUInt32(_uiTimesUsed[DECREQTPARM], "DECREQTPARM"), TraceLoggingUInt32(_uiTimesUsed[VPA], "VPA"), TraceLoggingUInt32(_uiTimesUsed[HPR], "HPR"), TraceLoggingUInt32(_uiTimesUsed[VPR], "VPR"), diff --git a/src/terminal/parser/telemetry.hpp b/src/terminal/parser/telemetry.hpp index 0da17fbc4fb..e33c83841b2 100644 --- a/src/terminal/parser/telemetry.hpp +++ b/src/terminal/parser/telemetry.hpp @@ -54,7 +54,6 @@ namespace Microsoft::Console::VirtualTerminal DA, DA2, DA3, - DECREQTPARM, VPA, HPR, VPR, diff --git a/src/terminal/parser/ut_parser/OutputEngineTest.cpp b/src/terminal/parser/ut_parser/OutputEngineTest.cpp index 8f0f8eb5bf8..5b9364a9c8b 100644 --- a/src/terminal/parser/ut_parser/OutputEngineTest.cpp +++ b/src/terminal/parser/ut_parser/OutputEngineTest.cpp @@ -991,8 +991,6 @@ class StatefulDispatch final : public TermDispatch _secondaryDeviceAttributes{ false }, _tertiaryDeviceAttributes{ false }, _vt52DeviceAttributes{ false }, - _requestTerminalParameters{ false }, - _reportingPermission{ (DispatchTypes::ReportingPermission)-1 }, _isAltBuffer{ false }, _cursorKeysMode{ false }, _cursorBlinking{ true }, @@ -1190,14 +1188,6 @@ class StatefulDispatch final : public TermDispatch return true; } - bool RequestTerminalParameters(const DispatchTypes::ReportingPermission permission) noexcept override - { - _requestTerminalParameters = true; - _reportingPermission = permission; - - return true; - } - bool _PrivateModeParamsHelper(_In_ DispatchTypes::PrivateModeParams const param, const bool fEnable) { bool fSuccess = false; @@ -1419,8 +1409,6 @@ class StatefulDispatch final : public TermDispatch bool _secondaryDeviceAttributes; bool _tertiaryDeviceAttributes; bool _vt52DeviceAttributes; - bool _requestTerminalParameters; - DispatchTypes::ReportingPermission _reportingPermission; bool _isAltBuffer; bool _cursorKeysMode; bool _cursorBlinking; @@ -2331,44 +2319,6 @@ class StateMachineExternalTest final pDispatch->ClearState(); } - TEST_METHOD(TestRequestTerminalParameters) - { - auto dispatch = std::make_unique(); - auto pDispatch = dispatch.get(); - auto engine = std::make_unique(std::move(dispatch)); - StateMachine mach(std::move(engine)); - - Log::Comment(L"Test 1: Check default case, no params."); - mach.ProcessCharacter(AsciiChars::ESC); - mach.ProcessCharacter(L'['); - mach.ProcessCharacter(L'x'); - - VERIFY_IS_TRUE(pDispatch->_requestTerminalParameters); - VERIFY_ARE_EQUAL(DispatchTypes::ReportingPermission::Unsolicited, pDispatch->_reportingPermission); - - pDispatch->ClearState(); - - Log::Comment(L"Test 2: Check unsolicited permission, 0 param."); - mach.ProcessCharacter(AsciiChars::ESC); - mach.ProcessCharacter(L'['); - mach.ProcessCharacter(L'0'); - mach.ProcessCharacter(L'x'); - - VERIFY_IS_TRUE(pDispatch->_requestTerminalParameters); - VERIFY_ARE_EQUAL(DispatchTypes::ReportingPermission::Unsolicited, pDispatch->_reportingPermission); - - Log::Comment(L"Test 3: Check solicited permission, 1 param."); - mach.ProcessCharacter(AsciiChars::ESC); - mach.ProcessCharacter(L'['); - mach.ProcessCharacter(L'1'); - mach.ProcessCharacter(L'x'); - - VERIFY_IS_TRUE(pDispatch->_requestTerminalParameters); - VERIFY_ARE_EQUAL(DispatchTypes::ReportingPermission::Solicited, pDispatch->_reportingPermission); - - pDispatch->ClearState(); - } - TEST_METHOD(TestStrings) { auto dispatch = std::make_unique();