From aba05ec06bb490d830cb9a17f41de1a4b03607b4 Mon Sep 17 00:00:00 2001 From: khvitaly Date: Mon, 12 Apr 2021 21:47:42 +0300 Subject: [PATCH] Prevent mouse dragging from dismissing existing selection --- src/cascadia/TerminalControl/TermControl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index c8df3a8ab65..5eede743df9 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -1418,6 +1418,13 @@ namespace winrt::Microsoft::Terminal::Control::implementation _selectionNeedsToBeCopied = true; } + if (_terminal->IsSelectionActive()) + { + // GH#9787: if selection is active we don't want to track the touchdown position + // so that dragging the mouse will extend the selection rather than starting the new one + _singleClickTouchdownPos = std::nullopt; + } + _renderer->TriggerSelection(); } else if (point.Properties().IsRightButtonPressed())