From 093743e365dd1c30004a5941bd54fe628020e1ad Mon Sep 17 00:00:00 2001 From: Akash Satheesan Date: Wed, 14 Apr 2021 18:58:17 +0530 Subject: [PATCH] fix(.../platform/terminal): fix compile, add notes --- lib/vscode/src/vs/platform/terminal/node/ptyService.ts | 7 +++++-- .../src/vs/platform/terminal/node/terminalProcess.ts | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/vscode/src/vs/platform/terminal/node/ptyService.ts b/lib/vscode/src/vs/platform/terminal/node/ptyService.ts index 813f5b6e..2930aa56 100644 --- a/lib/vscode/src/vs/platform/terminal/node/ptyService.ts +++ b/lib/vscode/src/vs/platform/terminal/node/ptyService.ts @@ -78,7 +78,10 @@ export class PtyService extends Disposable implements IPtyService { throw new Error('Attempt to create a process when attach object was provided'); } const id = ++this._lastPtyId; - const process = new TerminalProcess(shellLaunchConfig, cwd, cols, rows, env, executableEnv, windowsEnableConpty, this._logService); + /** + * NOTE@coder: pass ID into TerminalProcess to fix compile. + */ + const process = new TerminalProcess(id, shellLaunchConfig, cwd, cols, rows, env, executableEnv, windowsEnableConpty, this._logService); process.onProcessData(event => this._onProcessData.fire({ id, event })); process.onProcessExit(event => this._onProcessExit.fire({ id, event })); if (process.onProcessOverrideDimensions) { @@ -328,7 +331,7 @@ export class PersistentTerminalProcess extends Disposable { } return undefined; } - shutdown(immediate: boolean): Promise { + shutdown(immediate: boolean): void { return this._terminalProcess.shutdown(immediate); } input(data: string): void { diff --git a/lib/vscode/src/vs/platform/terminal/node/terminalProcess.ts b/lib/vscode/src/vs/platform/terminal/node/terminalProcess.ts index 6c288ae4..66986a14 100644 --- a/lib/vscode/src/vs/platform/terminal/node/terminalProcess.ts +++ b/lib/vscode/src/vs/platform/terminal/node/terminalProcess.ts @@ -50,6 +50,12 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess private _exitCode: number | undefined; private _exitMessage: string | undefined; private _closeTimeout: any; + /** + * NOTE@coder: set _ptyProcess and _currentTitle to protected + * to allow access from subclasses. + * + * We subclass it in src/vs/server/channel.ts + */ protected _ptyProcess: pty.IPty | undefined; protected _currentTitle: string = ''; private _processStartupComplete: Promise | undefined; @@ -80,6 +86,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess private readonly _onProcessShellTypeChanged = this._register(new Emitter()); public readonly onProcessShellTypeChanged = this._onProcessShellTypeChanged.event; + // NOTE@coder: add id to constructor constructor( public readonly id: number = 0, private readonly _shellLaunchConfig: IShellLaunchConfig,