Fix fetching remote backends for attach session command

Part of #136064
This commit is contained in:
Daniel Imms 2021-11-19 09:45:53 -08:00
parent 9ed1645650
commit ec4b7e10ab

View file

@ -970,11 +970,13 @@ export function registerTerminalActions() {
const labelService = accessor.get(ILabelService);
const remoteAgentService = accessor.get(IRemoteAgentService);
const notificationService = accessor.get(INotificationService);
const backend = accessor.get(ITerminalInstanceService).getBackend();
const terminalGroupService = accessor.get(ITerminalGroupService);
const remoteAuthority = remoteAgentService.getConnection()?.remoteAuthority ?? undefined;
const backend = accessor.get(ITerminalInstanceService).getBackend(remoteAuthority);
if (!backend) {
throw new Error(`No backend registered for remote authority '${remoteAgentService.getConnection()?.remoteAuthority ?? undefined}'`);
throw new Error(`No backend registered for remote authority '${remoteAuthority}'`);
}
const terms = await backend.listProcesses();