From 91380bd3ffae1cfb7d2096c539fc39d4c2b8f58a Mon Sep 17 00:00:00 2001 From: Nakul Date: Thu, 29 Oct 2026 05:26:08 +0530 Subject: [PATCH] Allow users to disable the new resize indicator (#20861) Adds a `showResizeOverlay` setting so the size overlay shown while resizing can be turned off. It's on by default, and there's a toggle for it on the Interaction page in the settings UI. Closes #20694 (cherry picked from commit 09beddc62315b7eb9e63949252102c4e9b431929) Service-Card-Id: PVTI_lADOAF3p4s4BlIihzhEVwQ8 Service-Version: 1.26 --- doc/cascadia/profiles.schema.json | 5 +++++ src/cascadia/TerminalControl/IControlSettings.idl | 1 + src/cascadia/TerminalControl/TermControl.cpp | 5 +++++ .../TerminalSettingsAppAdapterLib/TerminalSettings.cpp | 1 + src/cascadia/TerminalSettingsEditor/Interaction.xaml | 10 ++++++++++ .../TerminalSettingsEditor/InteractionViewModel.h | 1 + .../TerminalSettingsEditor/InteractionViewModel.idl | 1 + .../Resources/en-US/Resources.resw | 4 ++++ .../TerminalSettingsModel/GlobalAppSettings.idl | 1 + src/cascadia/TerminalSettingsModel/MTSMSettings.h | 1 + src/cascadia/inc/ControlProperties.h | 1 + 11 files changed, 31 insertions(+) diff --git a/doc/cascadia/profiles.schema.json b/doc/cascadia/profiles.schema.json index 5b933d3ec1..8cd4adf32d 100644 --- a/doc/cascadia/profiles.schema.json +++ b/doc/cascadia/profiles.schema.json @@ -2680,6 +2680,11 @@ "description": "When set to true, the window will snap to the nearest character boundary on resize. When false, the window will resize smoothly", "type": "boolean" }, + "showResizeOverlay": { + "default": true, + "description": "When set to true, the terminal shows its size (columns × rows) in an overlay while it is being resized. When false, the overlay is never shown.", + "type": "boolean" + }, "tabWidthMode": { "default": "equal", "description": "Sets the width of the tabs. Possible values include:\n -\"equal\" sizes each tab to the same width\n -\"titleLength\" sizes each tab to the length of its title\n -\"compact\" sizes each tab to the length of its title when focused, and shrinks to the size of only the icon when the tab is unfocused.", diff --git a/src/cascadia/TerminalControl/IControlSettings.idl b/src/cascadia/TerminalControl/IControlSettings.idl index 4682668e92..97c75f1ab0 100644 --- a/src/cascadia/TerminalControl/IControlSettings.idl +++ b/src/cascadia/TerminalControl/IControlSettings.idl @@ -55,6 +55,7 @@ namespace Microsoft.Terminal.Control Boolean CopyOnSelect { get; }; Microsoft.Terminal.Control.CopyFormat CopyFormatting { get; }; Boolean FocusFollowMouse { get; }; + Boolean ShowResizeOverlay { get; }; Boolean ScrollToZoom { get; }; Boolean ScrollToChangeOpacity { get; }; diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index ef030ad0f3..c3a847e1ad 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -2509,6 +2509,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation return; } + if (!_core->Settings().ShowResizeOverlay()) + { + return; + } + ResizeOverlayText().Text(fmt::format(FMT_COMPILE(L"{} \u00D7 {}"), size.Width, size.Height)); ResizeOverlay().Visibility(Visibility::Visible); diff --git a/src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.cpp b/src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.cpp index 96424c06cf..3f2b7af468 100644 --- a/src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.cpp +++ b/src/cascadia/TerminalSettingsAppAdapterLib/TerminalSettings.cpp @@ -389,6 +389,7 @@ namespace winrt::Microsoft::Terminal::Settings _CopyOnSelect = windowSettings.CopyOnSelect(); _CopyFormatting = windowSettings.CopyFormatting(); _FocusFollowMouse = windowSettings.FocusFollowMouse(); + _ShowResizeOverlay = windowSettings.ShowResizeOverlay(); _ScrollToZoom = windowSettings.ScrollToZoom(); _ScrollToChangeOpacity = windowSettings.ScrollToChangeOpacity(); _GraphicsAPI = windowSettings.GraphicsAPI(); diff --git a/src/cascadia/TerminalSettingsEditor/Interaction.xaml b/src/cascadia/TerminalSettingsEditor/Interaction.xaml index adb089a3e3..50ae1daa61 100644 --- a/src/cascadia/TerminalSettingsEditor/Interaction.xaml +++ b/src/cascadia/TerminalSettingsEditor/Interaction.xaml @@ -139,6 +139,16 @@ Style="{StaticResource ToggleSwitchInExpanderStyle}" /> + + + + + + + + diff --git a/src/cascadia/TerminalSettingsEditor/InteractionViewModel.h b/src/cascadia/TerminalSettingsEditor/InteractionViewModel.h index daba4d4a84..3487aa12bf 100644 --- a/src/cascadia/TerminalSettingsEditor/InteractionViewModel.h +++ b/src/cascadia/TerminalSettingsEditor/InteractionViewModel.h @@ -25,6 +25,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation PERMANENT_OBSERVABLE_PROJECTED_SETTING(_WindowSettings, TrimBlockSelection); PERMANENT_OBSERVABLE_PROJECTED_SETTING(_WindowSettings, TrimPaste); PERMANENT_OBSERVABLE_PROJECTED_SETTING(_WindowSettings, SnapToGridOnResize); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(_WindowSettings, ShowResizeOverlay); PERMANENT_OBSERVABLE_PROJECTED_SETTING(_WindowSettings, FocusFollowMouse); PERMANENT_OBSERVABLE_PROJECTED_SETTING(_WindowSettings, ScrollToZoom); PERMANENT_OBSERVABLE_PROJECTED_SETTING(_WindowSettings, ScrollToChangeOpacity); diff --git a/src/cascadia/TerminalSettingsEditor/InteractionViewModel.idl b/src/cascadia/TerminalSettingsEditor/InteractionViewModel.idl index f57ebe3714..8e99279dd2 100644 --- a/src/cascadia/TerminalSettingsEditor/InteractionViewModel.idl +++ b/src/cascadia/TerminalSettingsEditor/InteractionViewModel.idl @@ -24,6 +24,7 @@ namespace Microsoft.Terminal.Settings.Editor PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, TrimBlockSelection); PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, TrimPaste); PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, SnapToGridOnResize); + PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ShowResizeOverlay); PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, FocusFollowMouse); PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ScrollToZoom); PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ScrollToChangeOpacity); diff --git a/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw b/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw index 457511d40d..01a5e28ce8 100644 --- a/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw +++ b/src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw @@ -2258,6 +2258,10 @@ If enabled, the terminal will be hidden as soon as you switch to another window. A description for what the "Automatically hide window" setting does. + + Show terminal size when resizing + Header for a control to toggle whether the terminal shows its size (columns × rows) while it is being resized. + default Text label displayed adjacent to a "color scheme" entry signifying that it is currently set as the default color scheme to be used. diff --git a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl index 9ebee1d42d..9a97a99cb9 100644 --- a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl +++ b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl @@ -115,6 +115,7 @@ namespace Microsoft.Terminal.Settings.Model INHERITABLE_SETTING(Microsoft.Terminal.Control.DefaultInputScope, DefaultInputScope); INHERITABLE_SETTING(LaunchMode, LaunchMode); INHERITABLE_SETTING(Boolean, SnapToGridOnResize); + INHERITABLE_SETTING(Boolean, ShowResizeOverlay); INHERITABLE_SETTING(Microsoft.Terminal.Control.GraphicsAPI, GraphicsAPI); INHERITABLE_SETTING(Boolean, DisablePartialInvalidation); INHERITABLE_SETTING(Boolean, SoftwareRendering); diff --git a/src/cascadia/TerminalSettingsModel/MTSMSettings.h b/src/cascadia/TerminalSettingsModel/MTSMSettings.h index 4be395eb29..d9d28f44f7 100644 --- a/src/cascadia/TerminalSettingsModel/MTSMSettings.h +++ b/src/cascadia/TerminalSettingsModel/MTSMSettings.h @@ -63,6 +63,7 @@ Author(s): X(bool, CenterOnLaunch, "centerOnLaunch", false) \ X(Model::LaunchMode, LaunchMode, "launchMode", LaunchMode::DefaultMode) \ X(bool, SnapToGridOnResize, "snapToGridOnResize", true) \ + X(bool, ShowResizeOverlay, "showResizeOverlay", true) \ X(bool, AlwaysOnTop, "alwaysOnTop", false) \ X(bool, AutoHideWindow, "autoHideWindow", false) \ X(Model::TabSwitcherMode, TabSwitcherMode, "tabSwitcherMode", Model::TabSwitcherMode::InOrder) \ diff --git a/src/cascadia/inc/ControlProperties.h b/src/cascadia/inc/ControlProperties.h index e54cb14a24..cf8969c58f 100644 --- a/src/cascadia/inc/ControlProperties.h +++ b/src/cascadia/inc/ControlProperties.h @@ -42,6 +42,7 @@ X(winrt::hstring, WordDelimiters, DEFAULT_WORD_DELIMITERS) \ X(bool, CopyOnSelect, false) \ X(bool, FocusFollowMouse, false) \ + X(bool, ShowResizeOverlay, true) \ X(bool, ScrollToZoom, true) \ X(bool, ScrollToChangeOpacity, true) \ X(winrt::Windows::Foundation::IReference, TabColor, nullptr) \