@xterm/xterm 5.6.0-beta.64 → 5.6.0-beta.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/xterm.js +1 -1
- package/lib/xterm.js.map +1 -1
- package/lib/xterm.mjs +9 -9
- package/lib/xterm.mjs.map +3 -3
- package/package.json +2 -2
- package/src/browser/CoreBrowserTerminal.ts +4 -3
- package/src/browser/Linkifier.ts +11 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/xterm",
|
|
3
3
|
"description": "Full xterm terminal, in your browser",
|
|
4
|
-
"version": "5.6.0-beta.
|
|
4
|
+
"version": "5.6.0-beta.66",
|
|
5
5
|
"main": "lib/xterm.js",
|
|
6
6
|
"module": "lib/xterm.mjs",
|
|
7
7
|
"style": "css/xterm.css",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"ws": "^8.2.3",
|
|
108
108
|
"xterm-benchmark": "^0.3.1"
|
|
109
109
|
},
|
|
110
|
-
"commit": "
|
|
110
|
+
"commit": "a5fc111d623dccf009508489726959afb87e1011"
|
|
111
111
|
}
|
|
@@ -69,7 +69,8 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
|
|
|
69
69
|
private _helperContainer: HTMLElement | undefined;
|
|
70
70
|
private _compositionView: HTMLElement | undefined;
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
private readonly _linkifier: MutableDisposable<ILinkifier2> = this._register(new MutableDisposable());
|
|
73
|
+
public get linkifier(): ILinkifier2 | undefined { return this._linkifier.value; }
|
|
73
74
|
private _overviewRulerRenderer: OverviewRulerRenderer | undefined;
|
|
74
75
|
private _viewport: Viewport | undefined;
|
|
75
76
|
|
|
@@ -485,7 +486,7 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
|
|
|
485
486
|
this._mouseService = this._instantiationService.createInstance(MouseService);
|
|
486
487
|
this._instantiationService.setService(IMouseService, this._mouseService);
|
|
487
488
|
|
|
488
|
-
this.
|
|
489
|
+
const linkifier = this._linkifier.value = this._register(this._instantiationService.createInstance(Linkifier, this.screenElement));
|
|
489
490
|
|
|
490
491
|
// Performance: Add viewport and helper elements from the fragment
|
|
491
492
|
this.element.appendChild(fragment);
|
|
@@ -515,7 +516,7 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
|
|
|
515
516
|
this._selectionService = this._register(this._instantiationService.createInstance(SelectionService,
|
|
516
517
|
this.element,
|
|
517
518
|
this.screenElement,
|
|
518
|
-
|
|
519
|
+
linkifier
|
|
519
520
|
));
|
|
520
521
|
this._instantiationService.setService(ISelectionService, this._selectionService);
|
|
521
522
|
this._register(this._selectionService.onRequestScrollLines(e => this.scrollLines(e.amount, e.suppressScrollEvent)));
|
package/src/browser/Linkifier.ts
CHANGED
|
@@ -227,7 +227,7 @@ export class Linkifier extends Disposable implements ILinkifier2 {
|
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
if (this._mouseDownLink
|
|
230
|
+
if (this._mouseDownLink && linkEquals(this._mouseDownLink.link, this._currentLink.link) && this._linkAtPosition(this._currentLink.link, position)) {
|
|
231
231
|
this._currentLink.link.activate(event, this._currentLink.link.text);
|
|
232
232
|
}
|
|
233
233
|
}
|
|
@@ -391,3 +391,13 @@ export class Linkifier extends Disposable implements ILinkifier2 {
|
|
|
391
391
|
return { x1, y1, x2, y2, cols: this._bufferService.cols, fg };
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
+
|
|
395
|
+
function linkEquals(a: ILink, b: ILink): boolean {
|
|
396
|
+
return (
|
|
397
|
+
a.text === b.text &&
|
|
398
|
+
a.range.start.x === b.range.start.x &&
|
|
399
|
+
a.range.start.y === b.range.start.y &&
|
|
400
|
+
a.range.end.x === b.range.end.x &&
|
|
401
|
+
a.range.end.y === b.range.end.y
|
|
402
|
+
);
|
|
403
|
+
}
|