Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

Terminal link hover text stopped showing pointer cursor because markdown links have href="" after security sanitization. Browsers don't apply default link styles to empty href attributes.

  • Add cursor: pointer to .monaco-hover.workbench-hover a in hover.css

The href is intentionally cleared in rewriteRenderedLinks() (actual href stored in data-href, clicks handled via JS). This fix ensures links remain visually clickable.

Original prompt

This section details on the original issue you should resolve

<issue_title>Terminal link hover stopped being a link</issue_title>
<issue_description>This used to be a link you could click, allowing activating the link with mouse-only access:

Image

Label source:

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|&nbsp;)/.test(uri)) {
uri = nls.localize('followLinkUrl', 'Link');
}
return markdown.appendLink(uri, label).appendMarkdown(` (${clickLabel})`);
}

Hover creation:

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);
}
}
</issue_description>

<agent_instructions>Make sure you read the references provided. Investigate deeply and thoughtfully why terminal link hover stopped being a link </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: anthonykim1 <62267334+anthonykim1@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix terminal link hover functionality to be clickable Fix terminal link hover not appearing as a clickable link Dec 12, 2025
Copilot AI requested a review from anthonykim1 December 12, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal link hover stopped being a link

2 participants