-
Notifications
You must be signed in to change notification settings - Fork 8.9k
FIX#18877 Triple-click to select logical line #18885
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
Conversation
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Thanks!
|
@DHowett we should consider this for 1.23 as well /azp run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for doing this! excellent first contribution!
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Thank you so much. This was a great learning experience. |
|
@albus-droid Thanks!! I'd eagerly wait for this to make its way to the standard version... But two possible issues:
|
FWIW, this part of the code uses buffer coordinates where 0 is the top of the entire scrollback. It does indeed work if you select part of a line wrapped from above the top of the viewport. (In later issue replies I will probably use the terms "buffer" and "viewport"; the buffer is the entire scrollback plus active area, and the viewport is only the visible subset of that area.) |
|
@DHowett Ah, in that case this is perfect. (And apologies for talking before trying it; I'm still trying to convince my dev VM to work so I can install VS there to try it.) |
|
It's out in tonight's canary build if you'd rather not build it yourself! |
This fixes #18877, by iteratively checking to see if a line is wrapped and moving up or down accordingly. **Current behavior:** When a user triple-clicks on a line that’s visually wrapped by the terminal, only the single physical row that was clicked gets selected. **Expected behavior:** A triple-click like in xterm, should select the entire logical line including all of its wrapped segments, from the true start through its true end, regardless of where the wrap occurred. **Why it matters:** Logical line selection is what users expect when they’re trying to grab one command or output block in full. Limiting the selection to just the current physical row can lead to copy/paste mistakes and a confusing experience whenever a long line wraps. ## Validation Steps Performed I ran the existing tests using `Invoke-OpenConsoleTests` and they were passing and I was also able to test the build on my machine. I added a test case as well ## PR Checklist Closes #18877 (cherry picked from commit 976a54d) Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgaHgMU PVTI_lADOAF3p4s4AxadtzgaMvXs Service-Version: 1.23

Summary of the Pull Request
This fixes #18877, This iteratively checks to see if a line is wrapped and moves up or down accordingly.
Detailed Description of the Pull Request / Additional comments
Current behavior: When a user triple-clicks on a line that’s visually wrapped by the terminal, only the single physical row that was clicked gets selected.
Expected behavior: A triple-click like in xterm, should select the entire logical line including all of its wrapped segments, from the true start through its true end, regardless of where the wrap occurred.
Why it matters: Logical line selection is what users expect when they’re trying to grab one command or output block in full. Limiting the selection to just the current physical row can lead to copy/paste mistakes and a confusing experience whenever a long line wraps.
Validation Steps Performed
I ran the existing tests using
Invoke-OpenConsoleTestsand they were passing and I was also able to test the build on my machine. I added a test case as wellPR Checklist