diff --git a/main/src/extension/api/TerminalImpl.ts b/main/src/extension/api/TerminalImpl.ts index b1d7f20f..43550632 100644 --- a/main/src/extension/api/TerminalImpl.ts +++ b/main/src/extension/api/TerminalImpl.ts @@ -274,8 +274,8 @@ class ScreenImpl implements ExtensionApi.ScreenWithCursor, ExtensionApi.Disposab applyHyperlink(rowNumber: number, x: number, length: number, url: string): void { const emulator = this.#terminal.getEmulator(); const termLine = emulator.lineAtRow(rowNumber); - const startColumn = termLine.mapStringIndexToColumn(0, x); - const endColumn = termLine.mapStringIndexToColumn(0, x + length); + const startColumn = termLine.mapStringIndexToColumn(x); + const endColumn = termLine.mapStringIndexToColumn(x + length); const extensionName = this.#extensionMetadata.name; emulator.applyHyperlink(rowNumber, startColumn, endColumn - startColumn, url, extensionName); } diff --git a/main/src/terminal/TerminalBlock.ts b/main/src/terminal/TerminalBlock.ts index a36e0180..4be76f26 100644 --- a/main/src/terminal/TerminalBlock.ts +++ b/main/src/terminal/TerminalBlock.ts @@ -224,8 +224,8 @@ export class TerminalBlock implements Block { applyScrollbackHyperlink(lineNumber: number, x: number, length: number, url: string, group: string=""): void { const line = this.#scrollback[lineNumber]; - const startColumn = line.mapStringIndexToColumn(0, x); - const endColumn = line.mapStringIndexToColumn(0, x + length); + const startColumn = line.mapStringIndexToColumn(x); + const endColumn = line.mapStringIndexToColumn(x + length); this.#applyHyperlinkAtTextCoordinates(lineNumber, startColumn, endColumn - startColumn, url, group); diff --git a/packages/term-api/src/TermApi.ts b/packages/term-api/src/TermApi.ts index 4256a03e..e90c682b 100644 --- a/packages/term-api/src/TermApi.ts +++ b/packages/term-api/src/TermApi.ts @@ -48,7 +48,7 @@ export interface Line extends CharCellLine { getAllLinkIDs(group: string): number[]; pasteGridWithLinks(sourceGrid: Line, x: number): void; - mapStringIndexToColumn(line: number, x: number): number; + mapStringIndexToColumn(x: number): number; layers: Layer[]; }