diff --git a/src/cascadia/TerminalApp/AppActionHandlers.cpp b/src/cascadia/TerminalApp/AppActionHandlers.cpp index 1771dec0adf..5c0dc3d91ff 100644 --- a/src/cascadia/TerminalApp/AppActionHandlers.cpp +++ b/src/cascadia/TerminalApp/AppActionHandlers.cpp @@ -364,8 +364,15 @@ namespace winrt::TerminalApp::implementation { _ApplyToActiveControls([realArgs](auto& control) { Control::ScrollMark mark; - mark.Color.Color = realArgs.Color(); - mark.Color.HasValue = true; + if (realArgs.Color()) + { + mark.Color.Color = realArgs.Color().Value(); + mark.Color.HasValue = true; + } + else + { + mark.Color.HasValue = false; + } control.AddMark(mark); }); } diff --git a/src/cascadia/TerminalSettingsModel/ActionArgs.cpp b/src/cascadia/TerminalSettingsModel/ActionArgs.cpp index 4fc8201c1d6..0f3ed61aaa4 100644 --- a/src/cascadia/TerminalSettingsModel/ActionArgs.cpp +++ b/src/cascadia/TerminalSettingsModel/ActionArgs.cpp @@ -632,10 +632,18 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation winrt::hstring AddMarkArgs::GenerateName() const { - return winrt::hstring{ - fmt::format(std::wstring_view(RS_(L"AddMarkWithColorCommandKey")), - til::color{ Color() }.ToHexString(true)) - }; + if (Color()) + { + return winrt::hstring{ + fmt::format(std::wstring_view(RS_(L"AddMarkWithColorCommandKey")), + til::color{ Color().Value() }.ToHexString(true)) + }; + + } + else + { + return RS_(L"AddMarkCommandKey"); + } } winrt::hstring MoveTabArgs::GenerateName() const diff --git a/src/cascadia/TerminalSettingsModel/ActionArgs.h b/src/cascadia/TerminalSettingsModel/ActionArgs.h index 7dbd643765f..870de41b510 100644 --- a/src/cascadia/TerminalSettingsModel/ActionArgs.h +++ b/src/cascadia/TerminalSettingsModel/ActionArgs.h @@ -188,7 +188,7 @@ private: //////////////////////////////////////////////////////////////////////////////// #define ADD_MARK_ARGS(X) \ - X(til::color, Color, "color", false, 255, 255, 255) + X(Windows::Foundation::IReference, Color, "color", false, nullptr) //////////////////////////////////////////////////////////////////////////////// #define TOGGLE_COMMAND_PALETTE_ARGS(X) \ diff --git a/src/cascadia/TerminalSettingsModel/ActionArgs.idl b/src/cascadia/TerminalSettingsModel/ActionArgs.idl index d4253df0735..3b28e2c74c8 100644 --- a/src/cascadia/TerminalSettingsModel/ActionArgs.idl +++ b/src/cascadia/TerminalSettingsModel/ActionArgs.idl @@ -306,8 +306,7 @@ namespace Microsoft.Terminal.Settings.Model [default_interface] runtimeclass AddMarkArgs : IActionArgs { - Microsoft.Terminal.Core.Color Color { get; }; - // Windows.Foundation.IReference RowsToScroll { get; }; + Windows.Foundation.IReference Color { get; }; }; [default_interface] runtimeclass ToggleCommandPaletteArgs : IActionArgs