Use ptyHostService

Most of this was a straightforward replacement of our code with theirs
but I also removed `getDefaultShellAndArgs` since it seems the reference
implementation no longer does that either.

Fixes #2276.
This commit is contained in:
Asher
2021-05-07 11:19:01 -05:00
parent b21a9af473
commit c416e9b2c4
4 changed files with 76 additions and 337 deletions

View File

@@ -68,6 +68,7 @@ interface IWriteObject {
}
export class TerminalProcess extends Disposable implements ITerminalChildProcess {
readonly id = 0;
readonly shouldPersist = false;
private static _lastKillOrStart = 0;
@@ -75,14 +76,8 @@ 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 _ptyProcess: pty.IPty | undefined;
private _currentTitle: string = '';
private _processStartupComplete: Promise<void> | undefined;
private _isDisposed: boolean = false;
private _windowsShellHelper: WindowsShellHelper | undefined;
@@ -111,9 +106,7 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
private readonly _onProcessShellTypeChanged = this._register(new Emitter<TerminalShellType>());
public readonly onProcessShellTypeChanged = this._onProcessShellTypeChanged.event;
// NOTE@coder: add id to constructor
constructor(
public readonly id: number = 0,
private readonly _shellLaunchConfig: IShellLaunchConfig,
cwd: string,
cols: number,