Prevent cursor repositioning during mouse selection (#19182)

- Modify the cursor repositioning logic to check if a selection is in
progress
- Only reposition the cursor when the mouse is used for positioning, not
during selection operations

Closes #19181

(cherry picked from commit 88ab154f2227a3d8f213c1604ac19c8fb8dc5148)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgdSbu4
Service-Version: 1.23
This commit is contained in:
MQY 2025-08-05 05:09:08 +08:00 committed by Dustin L. Howett
parent ed022e89db
commit 4995af3dc1

View File

@ -2064,7 +2064,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
_terminal->MultiClickSelection(terminalPosition, mode);
selectionNeedsToBeCopied = true;
}
else if (_settings->RepositionCursorWithMouse()) // This is also mode==Char && !shiftEnabled
else if (_settings->RepositionCursorWithMouse() && !selectionNeedsToBeCopied) // Don't reposition cursor if this is part of a selection operation
{
_repositionCursorWithMouse(terminalPosition);
}