mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 01:00:29 -04:00
Merge from vscode 2cfc8172e533e50c90e6a3152f6bfb1f82f963f3 (#6516)
* Merge from vscode 2cfc8172e533e50c90e6a3152f6bfb1f82f963f3 * fix tests
This commit is contained in:
@@ -31,7 +31,7 @@ const LATENCY_MEASURING_INTERVAL = 1000;
|
||||
|
||||
enum ProcessType {
|
||||
Process,
|
||||
VirtualProcess
|
||||
ExtensionTerminal
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,6 +70,8 @@ export class TerminalProcessManager implements ITerminalProcessManager {
|
||||
public get onProcessExit(): Event<number> { return this._onProcessExit.event; }
|
||||
private readonly _onProcessOverrideDimensions = new Emitter<ITerminalDimensions | undefined>();
|
||||
public get onProcessOverrideDimensions(): Event<ITerminalDimensions | undefined> { return this._onProcessOverrideDimensions.event; }
|
||||
private readonly _onProcessOverrideShellLaunchConfig = new Emitter<IShellLaunchConfig>();
|
||||
public get onProcessResolvedShellLaunchConfig(): Event<IShellLaunchConfig> { return this._onProcessOverrideShellLaunchConfig.event; }
|
||||
|
||||
constructor(
|
||||
private readonly _terminalId: number,
|
||||
@@ -111,8 +113,8 @@ export class TerminalProcessManager implements ITerminalProcessManager {
|
||||
rows: number,
|
||||
isScreenReaderModeEnabled: boolean
|
||||
): Promise<void> {
|
||||
if (shellLaunchConfig.isVirtualProcess) {
|
||||
this._processType = ProcessType.VirtualProcess;
|
||||
if (shellLaunchConfig.isExtensionTerminal) {
|
||||
this._processType = ProcessType.ExtensionTerminal;
|
||||
this._process = this._instantiationService.createInstance(TerminalProcessExtHostProxy, this._terminalId, shellLaunchConfig, undefined, cols, rows, this._configHelper);
|
||||
} else {
|
||||
const forceExtHostProcess = (this._configHelper.config as any).extHostProcess;
|
||||
@@ -170,6 +172,9 @@ export class TerminalProcessManager implements ITerminalProcessManager {
|
||||
if (this._process.onProcessOverrideDimensions) {
|
||||
this._process.onProcessOverrideDimensions(e => this._onProcessOverrideDimensions.fire(e));
|
||||
}
|
||||
if (this._process.onProcessResolvedShellLaunchConfig) {
|
||||
this._process.onProcessResolvedShellLaunchConfig(e => this._onProcessOverrideShellLaunchConfig.fire(e));
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
if (this.processState === ProcessState.LAUNCHING) {
|
||||
@@ -234,7 +239,7 @@ export class TerminalProcessManager implements ITerminalProcessManager {
|
||||
}
|
||||
|
||||
public write(data: string): void {
|
||||
if (this.shellProcessId || this._processType === ProcessType.VirtualProcess) {
|
||||
if (this.shellProcessId || this._processType === ProcessType.ExtensionTerminal) {
|
||||
if (this._process) {
|
||||
// Send data if the pty is ready
|
||||
this._process.input(data);
|
||||
@@ -287,4 +292,4 @@ export class TerminalProcessManager implements ITerminalProcessManager {
|
||||
|
||||
this._onProcessExit.fire(exitCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user