MCPcopy
hub / github.com/xtermjs/xterm.js / _createHyperlink

Method _createHyperlink

src/common/InputHandler.ts:3026–3041  ·  view source on GitHub ↗
(params: string, uri: string)

Source from the content-addressed store, hash-verified

3024 }
3025
3026 private _createHyperlink(params: string, uri: string): boolean {
3027 // It's legal to open a new hyperlink without explicitly finishing the previous one
3028 if (this._getCurrentLinkId()) {
3029 this._finishHyperlink();
3030 }
3031 const parsedParams = params.split(':');
3032 let id: string | undefined;
3033 const idParamIndex = parsedParams.findIndex(e => e.startsWith('id='));
3034 if (idParamIndex !== -1) {
3035 id = parsedParams[idParamIndex].slice(3) || undefined;
3036 }
3037 this._curAttrData.extended = this._curAttrData.extended.clone();
3038 this._curAttrData.extended.urlId = this._oscLinkService.registerLink({ id, uri });
3039 this._curAttrData.updateExtended();
3040 return true;
3041 }
3042
3043 private _finishHyperlink(): boolean {
3044 this._curAttrData.extended = this._curAttrData.extended.clone();

Callers 1

setHyperlinkMethod · 0.95

Calls 5

_getCurrentLinkIdMethod · 0.95
_finishHyperlinkMethod · 0.95
cloneMethod · 0.65
registerLinkMethod · 0.65
updateExtendedMethod · 0.65

Tested by

no test coverage detected