Skip to content

Commit

Permalink
Get correct mouse cursor y regardless of MouseEvent.target
Browse files Browse the repository at this point in the history
Fixes #229965
  • Loading branch information
Tyriar committed Sep 27, 2024
1 parent 38b087c commit 2192418
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 2192418

Please sign in to comment.