Skip to content

Commit b2f55de

Browse files
authored
Prompt after turning on remote tunnel access does not display link properly (microsoft#172556)
1 parent 2238a14 commit b2f55de

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/vs/workbench/contrib/remoteTunnel/electron-sandbox/remoteTunnel.contribution.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
506506
if (connectionInfo) {
507507
const linkToOpen = that.getLinkToOpen(connectionInfo);
508508
const remoteExtension = that.serverConfiguration.extension;
509+
const linkToOpenForMarkdown = linkToOpen.toString().replace(/\)/g, '%29');
509510
await notificationService.notify({
510511
severity: Severity.Info,
511512
message:
@@ -515,11 +516,11 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
515516
comment: ['{0} will be a host name, {1} will the link address to the web UI, {6} an extesnion name. [label](command:commandId) is a markdown link. Only translate the label, do not modify the format']
516517
},
517518
"Remote tunnel access is enabled for [{0}](command:{4}). To access from a different machine, open [{1}]({2}) or use the {6} extension. Use the Account menu to [configure](command:{3}) or [turn off](command:{5}).",
518-
connectionInfo.hostName, connectionInfo.domain, linkToOpen, RemoteTunnelCommandIds.manage, RemoteTunnelCommandIds.configure, RemoteTunnelCommandIds.turnOff, remoteExtension.friendlyName
519+
connectionInfo.hostName, connectionInfo.domain, linkToOpenForMarkdown, RemoteTunnelCommandIds.manage, RemoteTunnelCommandIds.configure, RemoteTunnelCommandIds.turnOff, remoteExtension.friendlyName
519520
),
520521
actions: {
521522
primary: [
522-
new Action('copyToClipboard', localize('action.copyToClipboard', "Copy Browser Link to Clipboard"), undefined, true, () => clipboardService.writeText(linkToOpen)),
523+
new Action('copyToClipboard', localize('action.copyToClipboard', "Copy Browser Link to Clipboard"), undefined, true, () => clipboardService.writeText(linkToOpen.toString())),
523524
new Action('showExtension', localize('action.showExtension', "Show Extension"), undefined, true, () => {
524525
return commandService.executeCommand('workbench.extensions.action.showExtensionsWithIds', [remoteExtension.extensionId]);
525526
})
@@ -661,7 +662,7 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
661662
const clipboardService = accessor.get(IClipboardService);
662663
if (that.connectionInfo) {
663664
const linkToOpen = that.getLinkToOpen(that.connectionInfo);
664-
clipboardService.writeText(linkToOpen);
665+
clipboardService.writeText(linkToOpen.toString());
665666
}
666667

667668
}
@@ -684,7 +685,7 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
684685
}));
685686
}
686687

687-
private getLinkToOpen(connectionInfo: ConnectionInfo): string {
688+
private getLinkToOpen(connectionInfo: ConnectionInfo): URI {
688689
const workspace = this.workspaceContextService.getWorkspace();
689690
const folders = workspace.folders;
690691
let resource;
@@ -695,9 +696,9 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
695696
}
696697
const link = URI.parse(connectionInfo.link);
697698
if (resource?.scheme === Schemas.file) {
698-
return joinPath(link, resource.path).toString(true);
699+
return joinPath(link, resource.path);
699700
}
700-
return joinPath(link, this.environmentService.userHome.path).toString(true);
701+
return joinPath(link, this.environmentService.userHome.path);
701702
}
702703

703704

0 commit comments

Comments
 (0)