From 7a51e708ea4ad7588ecc1904cfd1d128248ff114 Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Fri, 31 Jan 2025 13:27:08 -0800 Subject: [PATCH 1/2] Bugfix: only round to the nearest cell for selection --- src/cascadia/TerminalControl/ControlInteractivity.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cascadia/TerminalControl/ControlInteractivity.cpp b/src/cascadia/TerminalControl/ControlInteractivity.cpp index f4c0feed2a3..a579c9cb109 100644 --- a/src/cascadia/TerminalControl/ControlInteractivity.cpp +++ b/src/cascadia/TerminalControl/ControlInteractivity.cpp @@ -241,7 +241,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation const ::Microsoft::Terminal::Core::ControlKeyStates modifiers, const Core::Point pixelPosition) { - const auto terminalPosition = _getTerminalPosition(til::point{ pixelPosition }, true); + // Follow-up from GH#18106: + // We DO NOT want to round to the nearest cell _unless_ we're selecting text. + const auto terminalPosition = _getTerminalPosition(til::point{ pixelPosition }, false); const auto altEnabled = modifiers.IsAltPressed(); const auto shiftEnabled = modifiers.IsShiftPressed(); @@ -285,7 +287,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation } const auto isOnOriginalPosition = _lastMouseClickPosNoSelection == pixelPosition; - _core->LeftClickOnTerminal(terminalPosition, + // Follow-up from GH#18106: + // We DO NOT want to round to the nearest cell _unless_ we're selecting text. + _core->LeftClickOnTerminal(_getTerminalPosition(til::point{ pixelPosition }, true), multiClickMapper, altEnabled, shiftEnabled, From 91a0e15087b2d503a61ec1b7c8817da3af3a5730 Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Fri, 31 Jan 2025 13:57:37 -0800 Subject: [PATCH 2/2] Remove unnecessary GH reference Co-authored-by: Dustin L. Howett --- src/cascadia/TerminalControl/ControlInteractivity.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cascadia/TerminalControl/ControlInteractivity.cpp b/src/cascadia/TerminalControl/ControlInteractivity.cpp index a579c9cb109..0fd2840a583 100644 --- a/src/cascadia/TerminalControl/ControlInteractivity.cpp +++ b/src/cascadia/TerminalControl/ControlInteractivity.cpp @@ -241,8 +241,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation const ::Microsoft::Terminal::Core::ControlKeyStates modifiers, const Core::Point pixelPosition) { - // Follow-up from GH#18106: - // We DO NOT want to round to the nearest cell _unless_ we're selecting text. + // Un-rounded coordinates; we only round when selecting text const auto terminalPosition = _getTerminalPosition(til::point{ pixelPosition }, false); const auto altEnabled = modifiers.IsAltPressed(); @@ -287,8 +286,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation } const auto isOnOriginalPosition = _lastMouseClickPosNoSelection == pixelPosition; - // Follow-up from GH#18106: - // We DO NOT want to round to the nearest cell _unless_ we're selecting text. + // Rounded coordinates for text selection _core->LeftClickOnTerminal(_getTerminalPosition(til::point{ pixelPosition }, true), multiClickMapper, altEnabled,