Fix selection markers appearing on scroll (#20045)

## 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 3104c8feb2)
Service-Card-Id: PVTI_lADOAF3p4s4BQX0-zgo0IB8
Service-Version: 1.25
This commit is contained in:
Carlos Zamora
2026-03-31 15:29:34 -07:00
committed by Dustin L. Howett
parent 2219739391
commit f7a5515cf7

View File

@@ -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<UpdateSelectionMarkersEventArgs>(false));
}