-
Couldn't load subscription status.
- Fork 35.8k
Open
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugterminal-links
Milestone
Description
This used to be a link you could click, allowing activating the link with mouse-only access:
Label source:
vscode/src/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkManager.ts
Lines 436 to 483 in da133d7
| private _getLinkHoverString(uri: string, label: string | undefined): IMarkdownString { | |
| const editorConf = this._configurationService.getValue<{ multiCursorModifier: 'ctrlCmd' | 'alt' }>('editor'); | |
| let clickLabel = ''; | |
| if (editorConf.multiCursorModifier === 'ctrlCmd') { | |
| if (isMacintosh) { | |
| clickLabel = nls.localize('terminalLinkHandler.followLinkAlt.mac', "option + click"); | |
| } else { | |
| clickLabel = nls.localize('terminalLinkHandler.followLinkAlt', "alt + click"); | |
| } | |
| } else { | |
| if (isMacintosh) { | |
| clickLabel = nls.localize('terminalLinkHandler.followLinkCmd', "cmd + click"); | |
| } else { | |
| clickLabel = nls.localize('terminalLinkHandler.followLinkCtrl', "ctrl + click"); | |
| } | |
| } | |
| let fallbackLabel = nls.localize('followLink', "Follow link"); | |
| try { | |
| if (this._tunnelService.canTunnel(URI.parse(uri))) { | |
| fallbackLabel = nls.localize('followForwardedLink', "Follow link using forwarded port"); | |
| } | |
| } catch { | |
| // No-op, already set to fallback | |
| } | |
| const markdown = new MarkdownString('', true); | |
| // Escapes markdown in label & uri | |
| if (label) { | |
| label = markdown.appendText(label).value; | |
| markdown.value = ''; | |
| } | |
| if (uri) { | |
| uri = markdown.appendText(uri).value; | |
| markdown.value = ''; | |
| } | |
| label = label || fallbackLabel; | |
| // Use the label when uri is '' so the link displays correctly | |
| uri = uri || label; | |
| // Although if there is a space in the uri, just replace it completely | |
| if (/(\s| )/.test(uri)) { | |
| uri = nls.localize('followLinkUrl', 'Link'); | |
| } | |
| return markdown.appendLink(uri, label).appendMarkdown(` (${clickLabel})`); | |
| } |
Hover creation:
vscode/src/vs/workbench/contrib/terminal/browser/widgets/terminalHoverWidget.ts
Lines 41 to 58 in da133d7
| attach(container: HTMLElement): void { | |
| const showLinkHover = this._configurationService.getValue(TerminalSettingId.ShowLinkHover); | |
| if (!showLinkHover) { | |
| return; | |
| } | |
| const target = new CellHoverTarget(container, this._targetOptions); | |
| const hover = this._hoverService.showInstantHover({ | |
| target, | |
| content: this._text, | |
| actions: this._actions, | |
| linkHandler: this._linkHandler, | |
| // .xterm-hover lets xterm know that the hover is part of a link | |
| additionalClasses: ['xterm-hover'] | |
| }); | |
| if (hover) { | |
| this._register(hover); | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugterminal-links