diff --git a/lib/vscode/src/vs/server/node/channel.ts b/lib/vscode/src/vs/server/node/channel.ts index 2753db67..769ce639 100644 --- a/lib/vscode/src/vs/server/node/channel.ts +++ b/lib/vscode/src/vs/server/node/channel.ts @@ -674,6 +674,7 @@ export class TerminalProviderChannel implements IServerChannel { + // TODO: args.isInitialization. Maybe this is to have slightly different + // behavior when first listing terminals but I don't know what you'd want to + // do differently. Maybe it's to reset the terminal dispose timeouts or + // something like that, but why not do it each time you list? + const terminals = await Promise.all(Array.from(this.terminals).map(async ([id, terminal]) => { + return terminal.description(id); + })); + + // Only returned orphaned terminals so we don't end up attaching to + // terminals already attached elsewhere. + return terminals.filter((t) => t.isOrphan); + } + public async setTerminalLayoutInfo(args: ISetTerminalLayoutInfoArgs): Promise { this.layouts.set(args.workspaceId, args); }