diff --git a/src/browser/Linkifier.ts b/src/browser/Linkifier.ts index 0b51d43f..ecaf8af9 100644 --- a/src/browser/Linkifier.ts +++ b/src/browser/Linkifier.ts @@ -306,7 +306,9 @@ export class Linkifier implements ILinkifier { e => { this._onLinkTooltip.fire(this._createLinkHoverEvent(x1, y1, x2, y2, fg)); if (matcher.hoverTooltipCallback) { - matcher.hoverTooltipCallback(e, uri, { start: { row: y1, col: x1 }, end: { row: y2, col: x2 } }); + // Note that IViewportRange use 1-based coordinates to align with escape sequences such + // as CUP which use 1,1 as the default for row/col + matcher.hoverTooltipCallback(e, uri, { start: { row: y1 + 1, col: x1 + 1 }, end: { row: y2 + 1, col: x2 } }); } }, () => { diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index e7b2247e..c1f5eab9 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -862,12 +862,12 @@ declare module 'xterm' { */ interface IViewportCellPosition { /** - * The column of the cell. + * The column of the cell. Note that this is 1-based; the first column is column 1. */ col: number; /** - * The row of the cell. + * The row of the cell. Note that this is 1-based; the first row is row 1. */ row: number; }