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
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/cascadia/TerminalControl/ControlCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

{
_repositionCursorWithMouse(terminalPosition);
}
}
_updateSelectionUI();
}
Expand Down