diff --git a/.github/actions/spell-check/dictionary/dictionary.txt b/.github/actions/spell-check/dictionary/dictionary.txt index d3590ea587f..c01a75b1927 100644 --- a/.github/actions/spell-check/dictionary/dictionary.txt +++ b/.github/actions/spell-check/dictionary/dictionary.txt @@ -284908,6 +284908,7 @@ overliing overliking overlimit overline +overlined overling overlinger overlinked diff --git a/src/buffer/out/TextAttribute.cpp b/src/buffer/out/TextAttribute.cpp index f9e1426d05a..da92768eef1 100644 --- a/src/buffer/out/TextAttribute.cpp +++ b/src/buffer/out/TextAttribute.cpp @@ -223,6 +223,11 @@ bool TextAttribute::IsUnderlined() const noexcept return WI_IsFlagSet(_wAttrLegacy, COMMON_LVB_UNDERSCORE); } +bool TextAttribute::IsOverlined() const noexcept +{ + return WI_IsFlagSet(_wAttrLegacy, COMMON_LVB_GRID_HORIZONTAL); +} + bool TextAttribute::IsReverseVideo() const noexcept { return WI_IsFlagSet(_wAttrLegacy, COMMON_LVB_REVERSE_VIDEO); @@ -259,6 +264,11 @@ void TextAttribute::SetUnderline(bool isUnderlined) noexcept WI_UpdateFlag(_wAttrLegacy, COMMON_LVB_UNDERSCORE, isUnderlined); } +void TextAttribute::SetOverline(bool isOverlined) noexcept +{ + WI_UpdateFlag(_wAttrLegacy, COMMON_LVB_GRID_HORIZONTAL, isOverlined); +} + void TextAttribute::SetReverseVideo(bool isReversed) noexcept { WI_UpdateFlag(_wAttrLegacy, COMMON_LVB_REVERSE_VIDEO, isReversed); diff --git a/src/buffer/out/TextAttribute.hpp b/src/buffer/out/TextAttribute.hpp index 24f0d85d883..7f645942c0e 100644 --- a/src/buffer/out/TextAttribute.hpp +++ b/src/buffer/out/TextAttribute.hpp @@ -95,6 +95,7 @@ class TextAttribute final bool IsInvisible() const noexcept; bool IsCrossedOut() const noexcept; bool IsUnderlined() const noexcept; + bool IsOverlined() const noexcept; bool IsReverseVideo() const noexcept; void SetBold(bool isBold) noexcept; @@ -103,6 +104,7 @@ class TextAttribute final void SetInvisible(bool isInvisible) noexcept; void SetCrossedOut(bool isCrossedOut) noexcept; void SetUnderline(bool isUnderlined) noexcept; + void SetOverline(bool isOverlined) noexcept; void SetReverseVideo(bool isReversed) noexcept; ExtendedAttributes GetExtendedAttributes() const noexcept; diff --git a/src/cascadia/TerminalCore/TerminalDispatchGraphics.cpp b/src/cascadia/TerminalCore/TerminalDispatchGraphics.cpp index 1c777864876..8efa3d859a0 100644 --- a/src/cascadia/TerminalCore/TerminalDispatchGraphics.cpp +++ b/src/cascadia/TerminalCore/TerminalDispatchGraphics.cpp @@ -157,6 +157,12 @@ bool TerminalDispatch::SetGraphicsRendition(const std::basic_string_view_attribute = TextAttribute{ 0 }; _testGetSet->_expectedAttribute = TextAttribute{ COMMON_LVB_UNDERSCORE }; break; + case DispatchTypes::GraphicsOptions::Overline: + Log::Comment(L"Testing graphics 'Overline'"); + _testGetSet->_attribute = TextAttribute{ 0 }; + _testGetSet->_expectedAttribute = TextAttribute{ COMMON_LVB_GRID_HORIZONTAL }; + break; case DispatchTypes::GraphicsOptions::Negative: Log::Comment(L"Testing graphics 'Negative'"); _testGetSet->_attribute = TextAttribute{ 0 }; @@ -1305,6 +1310,11 @@ class AdapterTest _testGetSet->_attribute = TextAttribute{ COMMON_LVB_UNDERSCORE }; _testGetSet->_expectedAttribute = TextAttribute{ 0 }; break; + case DispatchTypes::GraphicsOptions::NoOverline: + Log::Comment(L"Testing graphics 'No Overline'"); + _testGetSet->_attribute = TextAttribute{ COMMON_LVB_GRID_HORIZONTAL }; + _testGetSet->_expectedAttribute = TextAttribute{ 0 }; + break; case DispatchTypes::GraphicsOptions::Positive: Log::Comment(L"Testing graphics 'Positive'"); _testGetSet->_attribute = TextAttribute{ COMMON_LVB_REVERSE_VIDEO }; diff --git a/src/terminal/parser/ut_parser/OutputEngineTest.cpp b/src/terminal/parser/ut_parser/OutputEngineTest.cpp index f16ebf1aad5..3f5ea2a25ac 100644 --- a/src/terminal/parser/ut_parser/OutputEngineTest.cpp +++ b/src/terminal/parser/ut_parser/OutputEngineTest.cpp @@ -1602,6 +1602,9 @@ class StateMachineExternalTest final mach.ProcessCharacter(L';'); mach.ProcessCharacter(L'4'); mach.ProcessCharacter(L'5'); + mach.ProcessCharacter(L';'); + mach.ProcessCharacter(L'5'); + mach.ProcessCharacter(L'3'); mach.ProcessCharacter(L'm'); VERIFY_IS_TRUE(pDispatch->_setGraphics); @@ -1610,7 +1613,8 @@ class StateMachineExternalTest final rgExpected[2] = DispatchTypes::GraphicsOptions::Negative; rgExpected[3] = DispatchTypes::GraphicsOptions::ForegroundBlack; rgExpected[4] = DispatchTypes::GraphicsOptions::BackgroundMagenta; - VerifyDispatchTypes({ rgExpected, 5 }, *pDispatch); + rgExpected[5] = DispatchTypes::GraphicsOptions::Overline; + VerifyDispatchTypes({ rgExpected, 6 }, *pDispatch); pDispatch->ClearState(); @@ -1822,7 +1826,7 @@ class StateMachineExternalTest final Log::Comment(L"Test 2: A couple of sequences all in one string"); - mach.ProcessString(L"\x1b[1;4;7;30;45m\x1b[2J"); + mach.ProcessString(L"\x1b[1;4;7;30;45;53m\x1b[2J"); VERIFY_IS_TRUE(pDispatch->_setGraphics); VERIFY_IS_TRUE(pDispatch->_eraseDisplay); @@ -1831,8 +1835,9 @@ class StateMachineExternalTest final rgExpected[2] = DispatchTypes::GraphicsOptions::Negative; rgExpected[3] = DispatchTypes::GraphicsOptions::ForegroundBlack; rgExpected[4] = DispatchTypes::GraphicsOptions::BackgroundMagenta; + rgExpected[5] = DispatchTypes::GraphicsOptions::Overline; expectedDispatchTypes = DispatchTypes::EraseType::All; - VerifyDispatchTypes({ rgExpected, 5 }, *pDispatch); + VerifyDispatchTypes({ rgExpected, 6 }, *pDispatch); VERIFY_ARE_EQUAL(expectedDispatchTypes, pDispatch->_eraseType); pDispatch->ClearState();