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
This commit is contained in:
MQY 2025-08-05 05:09:08 +08:00 committed by GitHub
parent dbf740cf2c
commit 88ab154f22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2080,7 +2080,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);
}