From f7a5515cf7b5485dae6e0ade4f8022092235603f Mon Sep 17 00:00:00 2001 From: Carlos Zamora Date: Tue, 31 Mar 2026 15:29:34 -0700 Subject: [PATCH] Fix selection markers appearing on scroll (#20045) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary of the Pull Request Updates the scroll handler to check the selection mode before updating the markers. Introduced in #19974 ## Validation Steps Performed `ls` --> create selection --> scroll away and back ✅ keyboard selection: markers are present both times ✅ mouse selection: markers are missing both times (cherry picked from commit 3104c8feb26af29f2d728df14ca6c8e9c07096b7) Service-Card-Id: PVTI_lADOAF3p4s4BQX0-zgo0IB8 Service-Version: 1.25 --- src/cascadia/TerminalControl/TermControl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 5985fa2aeb..d1c0e60b5b 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -2517,9 +2517,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation _updateScrollBar->Run(update); - // if we have a selection, update the position of the markers - // (they may have been hidden when the endpoint scrolled out of view) - if (_core.HasSelection()) + // If we have a selection with markers (exposed via selection mode), + // update the position of the markers + if (_core.HasSelection() && _core.SelectionMode() >= SelectionInteractionMode::Keyboard) { _updateSelectionMarkers(nullptr, winrt::make(false)); }