[1.21] Selecting commands, output with the context menu is totally in the wrong place #21585

Closed
opened 2026-01-31 07:48:51 +00:00 by claunia · 2 comments
Owner

Originally created by @zadjii-msft on GitHub (Apr 25, 2024).

Originally assigned to: @zadjii-msft on GitHub.

open pwsh, with shell integration enabled

do a

cd Z:\dev\public\OpenConsole\
git status
dir
foo
whatever

try and right-click select the output of dir, and it's... wrong:

image

surely, I'm the murderer, but I could have swore there were tests for this

Originally created by @zadjii-msft on GitHub (Apr 25, 2024). Originally assigned to: @zadjii-msft on GitHub. open pwsh, with shell integration enabled do a ``` cd Z:\dev\public\OpenConsole\ git status dir foo whatever ``` try and right-click select the output of `dir`, and it's... wrong: ![image](https://github.com/microsoft/terminal/assets/18356694/99bee5a6-5e62-4d8a-8aea-b7d8acf018f6) surely, I'm the murderer, but I could have swore there were tests for this
claunia added the Issue-BugIn-PRNeeds-Tag-Fix labels 2026-01-31 07:48:51 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 25, 2024):

f36d589a8e/src/cascadia/TerminalCore/terminalrenderdata.cpp (L205-L214)

or prior:

d632c39cc3/src/cascadia/TerminalCore/terminalrenderdata.cpp (L171-L207)

Just staring at that in isolation, it's not clear to me what coordinate system the coord params of

SelectNewRegion(const til::point coordStart, const til::point coordEnd)

are

@zadjii-msft commented on GitHub (Apr 25, 2024): https://github.com/microsoft/terminal/blame/f36d589a8eb60fe9ff4c8efaad8eac088647e8a8/src/cascadia/TerminalCore/terminalrenderdata.cpp#L205-L214 or prior: https://github.com/microsoft/terminal/blame/d632c39cc3cef3075f09d881e03801518310d641/src/cascadia/TerminalCore/terminalrenderdata.cpp#L171-L207 Just staring at that in isolation, it's not clear to me what coordinate system the coord params of ```c++ SelectNewRegion(const til::point coordStart, const til::point coordEnd) ``` are
Author
Owner

@zadjii-msft commented on GitHub (Apr 25, 2024):

diff --git a/src/cascadia/TerminalCore/terminalrenderdata.cpp b/src/cascadia/TerminalCore/terminalrenderdata.cpp
index ec28b59d5..3d989f31f 100644
--- a/src/cascadia/TerminalCore/terminalrenderdata.cpp
+++ b/src/cascadia/TerminalCore/terminalrenderdata.cpp
@@ -199,7 +199,7 @@ til::CoordType Terminal::_ScrollToPoints(const til::point coordStart, const til:
         _NotifyScrollEvent();
     }

-    return _scrollOffset;
+    return _VisibleStartIndex();
 }

 void Terminal::SelectNewRegion(const til::point coordStart, const til::point coordEnd)

this fixes it. Need to write a test

@zadjii-msft commented on GitHub (Apr 25, 2024): ```diff diff --git a/src/cascadia/TerminalCore/terminalrenderdata.cpp b/src/cascadia/TerminalCore/terminalrenderdata.cpp index ec28b59d5..3d989f31f 100644 --- a/src/cascadia/TerminalCore/terminalrenderdata.cpp +++ b/src/cascadia/TerminalCore/terminalrenderdata.cpp @@ -199,7 +199,7 @@ til::CoordType Terminal::_ScrollToPoints(const til::point coordStart, const til: _NotifyScrollEvent(); } - return _scrollOffset; + return _VisibleStartIndex(); } void Terminal::SelectNewRegion(const til::point coordStart, const til::point coordEnd) ``` this fixes it. Need to write a test
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21585