diff --git a/src/terminal/adapter/adaptDispatch.cpp b/src/terminal/adapter/adaptDispatch.cpp index 36d80932b4a..8e1da0e32f8 100644 --- a/src/terminal/adapter/adaptDispatch.cpp +++ b/src/terminal/adapter/adaptDispatch.cpp @@ -1389,7 +1389,7 @@ bool AdaptDispatch::UseMainScreenBuffer() //Arguments: // - None // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::HorizontalTabSet() { return !!_conApi->PrivateHorizontalTabSet(); @@ -1403,7 +1403,7 @@ bool AdaptDispatch::HorizontalTabSet() //Arguments: // - sNumTabs - the number of tabs to perform // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::ForwardTab(const SHORT sNumTabs) { return !!_conApi->PrivateForwardTab(sNumTabs); @@ -1415,7 +1415,7 @@ bool AdaptDispatch::ForwardTab(const SHORT sNumTabs) //Arguments: // - sNumTabs - the number of tabs to perform // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::BackwardsTab(const SHORT sNumTabs) { return !!_conApi->PrivateBackwardsTab(sNumTabs); @@ -1428,7 +1428,7 @@ bool AdaptDispatch::BackwardsTab(const SHORT sNumTabs) //Arguments: // - sClearType - Whether to clear the current column, or all columns, defined in DispatchTypes::TabClearType // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::TabClear(const SHORT sClearType) { bool fSuccess = false; @@ -1453,7 +1453,7 @@ bool AdaptDispatch::TabClear(const SHORT sClearType) //Arguments: // - wchCharset - The character indicating the charset we should switch to. // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::DesignateCharset(const wchar_t wchCharset) { return _TermOutput.DesignateCharset(wchCharset); @@ -1489,7 +1489,7 @@ bool AdaptDispatch::DesignateCharset(const wchar_t wchCharset) //Arguments: // // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::SoftReset() { bool fSuccess = CursorVisibility(true); // Cursor enabled. @@ -1542,7 +1542,7 @@ bool AdaptDispatch::SoftReset() //Arguments: // // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::HardReset() { // Clears the screen - Needs to be done in two operations. @@ -1581,7 +1581,7 @@ bool AdaptDispatch::HardReset() //Arguments: // // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::_EraseScrollback() { CONSOLE_SCREEN_BUFFER_INFOEX csbiex = { 0 }; @@ -1667,7 +1667,7 @@ bool AdaptDispatch::_EraseScrollback() //Arguments: // // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::_EraseAll() { return !!_conApi->PrivateEraseAll(); @@ -1678,7 +1678,7 @@ bool AdaptDispatch::_EraseAll() //Arguments: // - fEnabled - true to enable, false to disable. // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::EnableVT200MouseMode(const bool fEnabled) { return !!_conApi->PrivateEnableVT200MouseMode(fEnabled); @@ -1690,7 +1690,7 @@ bool AdaptDispatch::EnableVT200MouseMode(const bool fEnabled) //Arguments: // - fEnabled - true to enable, false to disable. // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::EnableUTF8ExtendedMouseMode(const bool fEnabled) { return !!_conApi->PrivateEnableUTF8ExtendedMouseMode(fEnabled); @@ -1702,7 +1702,7 @@ bool AdaptDispatch::EnableUTF8ExtendedMouseMode(const bool fEnabled) //Arguments: // - fEnabled - true to enable, false to disable. // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::EnableSGRExtendedMouseMode(const bool fEnabled) { return !!_conApi->PrivateEnableSGRExtendedMouseMode(fEnabled); @@ -1713,7 +1713,7 @@ bool AdaptDispatch::EnableSGRExtendedMouseMode(const bool fEnabled) //Arguments: // - fEnabled - true to enable, false to disable. // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::EnableButtonEventMouseMode(const bool fEnabled) { return !!_conApi->PrivateEnableButtonEventMouseMode(fEnabled); @@ -1725,7 +1725,7 @@ bool AdaptDispatch::EnableButtonEventMouseMode(const bool fEnabled) //Arguments: // - fEnabled - true to enable, false to disable. // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::EnableAnyEventMouseMode(const bool fEnabled) { return !!_conApi->PrivateEnableAnyEventMouseMode(fEnabled); @@ -1737,7 +1737,7 @@ bool AdaptDispatch::EnableAnyEventMouseMode(const bool fEnabled) //Arguments: // - fEnabled - true to enable, false to disable. // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::EnableAlternateScroll(const bool fEnabled) { return !!_conApi->PrivateEnableAlternateScroll(fEnabled); @@ -1749,7 +1749,7 @@ bool AdaptDispatch::EnableAlternateScroll(const bool fEnabled) //Arguments: // - cursorStyle - The unix-like cursor style to apply to the cursor // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::SetCursorStyle(const DispatchTypes::CursorStyle cursorStyle) { bool isPty = false; @@ -1808,7 +1808,7 @@ bool AdaptDispatch::SetCursorStyle(const DispatchTypes::CursorStyle cursorStyle) // - tableIndex: The VT color table index // - dwColor: The new RGB color value to use. // Return Value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::SetCursorColor(const COLORREF cursorColor) { bool isPty = false; @@ -1827,7 +1827,7 @@ bool AdaptDispatch::SetCursorColor(const COLORREF cursorColor) // - tableIndex: The VT color table index // - dwColor: The new RGB color value to use. // Return Value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::SetColorTableEntry(const size_t tableIndex, const DWORD dwColor) { @@ -1857,7 +1857,7 @@ bool AdaptDispatch::SetColorTableEntry(const size_t tableIndex, const DWORD dwCo // Arguments: // - dwColor: The new RGB color value to use, as a COLORREF, format 0x00BBGGRR. // Return Value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool Microsoft::Console::VirtualTerminal::AdaptDispatch::SetDefaultForeground(const DWORD dwColor) { bool fSuccess = true; @@ -1882,7 +1882,7 @@ bool Microsoft::Console::VirtualTerminal::AdaptDispatch::SetDefaultForeground(co // Arguments: // - dwColor: The new RGB color value to use, as a COLORREF, format 0x00BBGGRR. // Return Value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool Microsoft::Console::VirtualTerminal::AdaptDispatch::SetDefaultBackground(const DWORD dwColor) { bool fSuccess = true; @@ -1913,7 +1913,7 @@ bool Microsoft::Console::VirtualTerminal::AdaptDispatch::SetDefaultBackground(co // - rgusParams - Additional parameters to pass to the function // - cParams - size of rgusParams // Return value: -// True if handled successfully. False othewise. +// True if handled successfully. False otherwise. bool AdaptDispatch::WindowManipulation(const DispatchTypes::WindowManipulationType uiFunction, _In_reads_(cParams) const unsigned short* const rgusParams, const size_t cParams) diff --git a/src/terminal/adapter/adaptDispatch.hpp b/src/terminal/adapter/adaptDispatch.hpp index d14c1673a10..53ce1de4ec1 100644 --- a/src/terminal/adapter/adaptDispatch.hpp +++ b/src/terminal/adapter/adaptDispatch.hpp @@ -97,8 +97,8 @@ namespace Microsoft::Console::VirtualTerminal virtual bool SetCursorColor(const COLORREF cursorColor); virtual bool SetColorTableEntry(const size_t tableIndex, const DWORD dwColor); // OscColorTable - virtual bool SetDefaultForeground(const DWORD /*dwColor*/); // OSCDefaultForeground - virtual bool SetDefaultBackground(const DWORD /*dwColor*/); // OSCDefaultBackground + virtual bool SetDefaultForeground(const DWORD dwColor); // OSCDefaultForeground + virtual bool SetDefaultBackground(const DWORD dwColor); // OSCDefaultBackground virtual bool WindowManipulation(const DispatchTypes::WindowManipulationType uiFunction, _In_reads_(cParams) const unsigned short* const rgusParams, diff --git a/src/terminal/adapter/ut_adapter/adapterTest.cpp b/src/terminal/adapter/ut_adapter/adapterTest.cpp index cc6afeed656..7289d6bedd5 100644 --- a/src/terminal/adapter/ut_adapter/adapterTest.cpp +++ b/src/terminal/adapter/ut_adapter/adapterTest.cpp @@ -779,23 +779,23 @@ class TestGetSet final : public ConGetSet BOOL PrivateSetDefaultForeground(const COLORREF value) const noexcept override { Log::Comment(L"PrivateSetDefaultForeground MOCK called..."); - if (_fPrivateSetDefaultColorResult) + if (_fPrivateSetDefaultForegroundResult) { - VERIFY_ARE_EQUAL(_expectedColorValue, value); + VERIFY_ARE_EQUAL(_expectedDefaultForegroundColorValue, value); } - return _fPrivateSetDefaultColorResult; + return _fPrivateSetDefaultForegroundResult; } BOOL PrivateSetDefaultBackground(const COLORREF value) const noexcept override { Log::Comment(L"PrivateSetDefaultForeground MOCK called..."); - if (_fPrivateSetDefaultColorResult) + if (_fPrivateSetDefaultBackgroundResult) { - VERIFY_ARE_EQUAL(_expectedColorValue, value); + VERIFY_ARE_EQUAL(_expectedDefaultBackgroundColorValue, value); } - return _fPrivateSetDefaultColorResult; + return _fPrivateSetDefaultBackgroundResult; } void _IncrementCoordPos(_Inout_ COORD* pcoord) @@ -1400,7 +1400,11 @@ class TestGetSet final : public ConGetSet short _expectedColorTableIndex = -1; COLORREF _expectedColorValue = INVALID_COLOR; - bool _fPrivateSetDefaultColorResult = false; + bool _fPrivateSetDefaultForegroundResult = false; + COLORREF _expectedDefaultForegroundColorValue = INVALID_COLOR; + + bool _fPrivateSetDefaultBackgroundResult = false; + COLORREF _expectedDefaultBackgroundColorValue = INVALID_COLOR; private: HANDLE _hCon; diff --git a/src/terminal/parser/OutputStateMachineEngine.hpp b/src/terminal/parser/OutputStateMachineEngine.hpp index 1c9cb3824a0..11ad0d8bfc1 100644 --- a/src/terminal/parser/OutputStateMachineEngine.hpp +++ b/src/terminal/parser/OutputStateMachineEngine.hpp @@ -257,8 +257,8 @@ namespace Microsoft::Console::VirtualTerminal _Out_ DWORD* const pRgb); bool _GetOscSetColor(_In_reads_(cchOscString) const wchar_t* const pwchOscStringBuffer, - const size_t cchOscString, - _Out_ DWORD* const pRgb) const; + const size_t cchOscString, + _Out_ DWORD* const pRgb) const; static const DispatchTypes::CursorStyle s_defaultCursorStyle = DispatchTypes::CursorStyle::BlinkingBlockDefault; _Success_(return)