Skip to content

Commit

Permalink
Merge pull request microsoft#230004 from microsoft/tyriar/229965
Browse files Browse the repository at this point in the history
Get correct mouse cursor y regardless of MouseEvent.target
  • Loading branch information
Tyriar authored Sep 28, 2024
2 parents cb9f166 + 2192418 commit 7308a15
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class TerminalCommandGuideContribution extends Disposable implements ITerminalCo
if (!rect) {
return;
}
const mouseCursorY = Math.floor(e.offsetY / (rect.height / xterm.raw.rows));
const mouseCursorY = Math.floor((e.clientY - rect.top) / (rect.height / xterm.raw.rows));
const command = this._instance.capabilities.get(TerminalCapability.CommandDetection)?.getCommandForLine(xterm.raw.buffer.active.viewportY + mouseCursorY);
if (command && 'getOutput' in command) {
xterm.markTracker.showCommandGuide(command);
Expand Down

0 comments on commit 7308a15

Please sign in to comment.