fix(lib/vscode): add listProcesses to terminal channel
This commit is contained in:
parent
feb7013b3a
commit
b1fb9f780b
@ -674,6 +674,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
|
|||||||
case '$getCwd': return this.getTerminalCwd(...args as [number]);
|
case '$getCwd': return this.getTerminalCwd(...args as [number]);
|
||||||
case '$sendCommandResult': return this.sendCommandResultToTerminalProcess(...args as [number, number, boolean, any]);
|
case '$sendCommandResult': return this.sendCommandResultToTerminalProcess(...args as [number, number, boolean, any]);
|
||||||
case '$orphanQuestionReply': return this.orphanQuestionReply(...args as [number]);
|
case '$orphanQuestionReply': return this.orphanQuestionReply(...args as [number]);
|
||||||
|
case '$listProcesses': return this.listProcesses();
|
||||||
case '$setTerminalLayoutInfo': return this.setTerminalLayoutInfo(args);
|
case '$setTerminalLayoutInfo': return this.setTerminalLayoutInfo(args);
|
||||||
case '$getTerminalLayoutInfo': return this.getTerminalLayoutInfo(args);
|
case '$getTerminalLayoutInfo': return this.getTerminalLayoutInfo(args);
|
||||||
}
|
}
|
||||||
@ -866,6 +867,20 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
|
|||||||
throw new Error('not implemented');
|
throw new Error('not implemented');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async listProcesses(): Promise<IProcessDetails[]> {
|
||||||
|
// 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<void> {
|
public async setTerminalLayoutInfo(args: ISetTerminalLayoutInfoArgs): Promise<void> {
|
||||||
this.layouts.set(args.workspaceId, args);
|
this.layouts.set(args.workspaceId, args);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user