Skip to content

Commit ec4b7e1

Browse files
committed
Fix fetching remote backends for attach session command
Part of microsoft#136064
1 parent 9ed1645 commit ec4b7e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/vs/workbench/contrib/terminal/browser/terminalActions.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -970,11 +970,13 @@ export function registerTerminalActions() {
970970
const labelService = accessor.get(ILabelService);
971971
const remoteAgentService = accessor.get(IRemoteAgentService);
972972
const notificationService = accessor.get(INotificationService);
973-
const backend = accessor.get(ITerminalInstanceService).getBackend();
974973
const terminalGroupService = accessor.get(ITerminalGroupService);
975974

975+
const remoteAuthority = remoteAgentService.getConnection()?.remoteAuthority ?? undefined;
976+
const backend = accessor.get(ITerminalInstanceService).getBackend(remoteAuthority);
977+
976978
if (!backend) {
977-
throw new Error(`No backend registered for remote authority '${remoteAgentService.getConnection()?.remoteAuthority ?? undefined}'`);
979+
throw new Error(`No backend registered for remote authority '${remoteAuthority}'`);
978980
}
979981

980982
const terms = await backend.listProcesses();

0 commit comments

Comments
 (0)