mirror of
https://github.com/coder/code-server.git
synced 2026-05-05 20:15:19 +02:00
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:
@@ -79,10 +79,7 @@ export class PtyService extends Disposable implements IPtyService {
|
||||
throw new Error('Attempt to create a process when attach object was provided');
|
||||
}
|
||||
const id = ++this._lastPtyId;
|
||||
/**
|
||||
* NOTE@coder: pass ID into TerminalProcess to fix compile.
|
||||
*/
|
||||
const process = new TerminalProcess(id, shellLaunchConfig, cwd, cols, rows, env, executableEnv, windowsEnableConpty, this._logService);
|
||||
const process = new TerminalProcess(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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user