Fixes #112446: Avoid timeouts in mirroring terminals to the extension host by assigning a temporary UUID to terminals created on the extension host side

This commit is contained in:
Alexandru Dima
2021-01-07 00:13:42 +01:00
parent e4fe157544
commit 3d8888779d
5 changed files with 150 additions and 185 deletions

View File

@@ -442,6 +442,16 @@ export interface MainThreadProgressShape extends IDisposable {
$progressEnd(handle: number): void;
}
/**
* A terminal that is created on the extension host side is temporarily assigned
* a UUID by the extension host that created it. Once the renderer side has assigned
* a real numeric id, the numeric id will be used.
*
* All other terminals (that are not created on the extension host side) always
* use the numeric id.
*/
export type TerminalIdentifier = number | string;
export interface TerminalLaunchConfig {
name?: string;
shellPath?: string;
@@ -456,11 +466,11 @@ export interface TerminalLaunchConfig {
}
export interface MainThreadTerminalServiceShape extends IDisposable {
$createTerminal(config: TerminalLaunchConfig): Promise<{ id: number, name: string; }>;
$dispose(terminalId: number): void;
$hide(terminalId: number): void;
$sendText(terminalId: number, text: string, addNewLine: boolean): void;
$show(terminalId: number, preserveFocus: boolean): void;
$createTerminal(extHostTerminalId: string, config: TerminalLaunchConfig): Promise<void>;
$dispose(id: TerminalIdentifier): void;
$hide(id: TerminalIdentifier): void;
$sendText(id: TerminalIdentifier, text: string, addNewLine: boolean): void;
$show(id: TerminalIdentifier, preserveFocus: boolean): void;
$startSendingDataEvents(): void;
$stopSendingDataEvents(): void;
$startLinkProvider(): void;
@@ -1524,7 +1534,7 @@ export interface ITerminalDimensionsDto {
export interface ExtHostTerminalServiceShape {
$acceptTerminalClosed(id: number, exitCode: number | undefined): void;
$acceptTerminalOpened(id: number, name: string, shellLaunchConfig: IShellLaunchConfigDto): void;
$acceptTerminalOpened(id: number, extHostTerminalId: string | undefined, name: string, shellLaunchConfig: IShellLaunchConfigDto): void;
$acceptActiveTerminalChanged(id: number | null): void;
$acceptTerminalProcessId(id: number, processId: number): void;
$acceptTerminalProcessData(id: number, data: string): void;