fix extension pty terminal test failures (#135672)

This commit is contained in:
Megan Rogge
2021-10-22 22:15:18 -05:00
committed by GitHub
parent 870aa86258
commit af0c0342ed
18 changed files with 248 additions and 386 deletions

View File

@@ -10,7 +10,7 @@ import { URI } from 'vs/base/common/uri';
import { StopWatch } from 'vs/base/common/stopwatch';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ILogService } from 'vs/platform/log/common/log';
import { IShellLaunchConfig, IShellLaunchConfigDto, ITerminalDimensions, TerminalLocation, TitleEventSource } from 'vs/platform/terminal/common/terminal';
import { IProcessProperty, IShellLaunchConfig, IShellLaunchConfigDto, ProcessPropertyType, TerminalLocation, TitleEventSource } from 'vs/platform/terminal/common/terminal';
import { TerminalDataBufferer } from 'vs/platform/terminal/common/terminalDataBuffering';
import { ITerminalEditorService, ITerminalExternalLinkProvider, ITerminalGroupService, ITerminalInstance, ITerminalInstanceService, ITerminalLink, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
import { TerminalProcessExtHostProxy } from 'vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy';
@@ -303,18 +303,6 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
proxy.onRequestLatency(() => this._onRequestLatency(proxy.instanceId));
}
public $sendProcessTitle(terminalId: number, title: string): void {
// Since title events can only come from vscode.Pseudoterminals right now, these are routed
// directly to the instance as API source events such that they will replace the initial
// `name` property provided for the Pseudoterminal. If we support showing both Api and
// Process titles at the same time we may want to pass this through as a Process source
// event.
const instance = this._terminalService.getInstanceFromId(terminalId);
if (instance) {
instance.refreshTabLabels(title, TitleEventSource.Api);
}
}
public $sendProcessData(terminalId: number, data: string): void {
this._terminalProcessProxies.get(terminalId)?.emitData(data);
}
@@ -323,24 +311,14 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
this._terminalProcessProxies.get(terminalId)?.emitReady(pid, cwd);
}
public $sendProcessExit(terminalId: number, exitCode: number | undefined): void {
this._terminalProcessProxies.get(terminalId)?.emitExit(exitCode);
}
public $sendOverrideDimensions(terminalId: number, dimensions: ITerminalDimensions | undefined): void {
this._terminalProcessProxies.get(terminalId)?.emitOverrideDimensions(dimensions);
}
public $sendProcessInitialCwd(terminalId: number, initialCwd: string): void {
this._terminalProcessProxies.get(terminalId)?.emitInitialCwd(initialCwd);
}
public $sendProcessCwd(terminalId: number, cwd: string): void {
this._terminalProcessProxies.get(terminalId)?.emitCwd(cwd);
}
public $sendResolvedLaunchConfig(terminalId: number, shellLaunchConfig: IShellLaunchConfig): void {
this._getTerminalProcess(terminalId)?.emitResolvedShellLaunchConfig(shellLaunchConfig);
public $sendProcessProperty(terminalId: number, property: IProcessProperty<any>): void {
if (property.type === ProcessPropertyType.Title) {
const instance = this._terminalService.getInstanceFromId(terminalId);
if (instance) {
instance.refreshTabLabels(property.value, TitleEventSource.Api);
}
}
this._terminalProcessProxies.get(terminalId)?.emitProcessProperty(property);
}
private async _onRequestLatency(terminalId: number): Promise<void> {