Skip to content

fix(ControlCore): prevent cursor repositioning during mouse selection #19182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MengAiDev
Copy link

@MengAiDev MengAiDev commented Jul 28, 2025

References and Relevant Issues

#19181

Detailed Description of the Pull Request / Additional comments

  • 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

- 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
@@ -2071,7 +2071,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
else if (_settings->RepositionCursorWithMouse()) // This is also mode==Char && !shiftEnabled
{
_repositionCursorWithMouse(terminalPosition);
// Don't reposition cursor if this is part of a selection operation
if (!selectionNeedsToBeCopied)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can merge this with the else-if above.

To me this change makes sense. What about you @zadjii-msft?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have pushed a commit to make code more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants