Merge pull request #117766 from microsoft/tyriar/remove_flow_control
Remove flow control setting
This commit is contained in:
commit
cb7ad05cb7
12 changed files with 14 additions and 39 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "code-oss-dev",
|
||||
"version": "1.55.0",
|
||||
"distro": "554eb3a374b57363e730dd1aacc561a4c9da5780",
|
||||
"distro": "d8be554a1c1d72fb929c31336025a2ca9d73591b",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
|
|
|
@ -226,11 +226,6 @@ export interface IShellLaunchConfig {
|
|||
*/
|
||||
isFeatureTerminal?: boolean;
|
||||
|
||||
/**
|
||||
* Whether flow control is enabled for this terminal.
|
||||
*/
|
||||
flowControl?: boolean;
|
||||
|
||||
/**
|
||||
* Whether this terminal was created by an extension.
|
||||
*/
|
||||
|
|
|
@ -38,7 +38,6 @@ export interface ICompleteTerminalConfiguration {
|
|||
'terminal.integrated.inheritEnv': boolean;
|
||||
'terminal.integrated.cwd': string;
|
||||
'terminal.integrated.detectLocale': 'auto' | 'off' | 'on';
|
||||
'terminal.flowControl': boolean;
|
||||
}
|
||||
|
||||
export type ITerminalEnvironmentVariableCollections = [string, ISerializableEnvironmentVariableCollection][];
|
||||
|
|
|
@ -188,14 +188,15 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
|
|||
this.onProcessReady(() => c());
|
||||
});
|
||||
ptyProcess.onData(data => {
|
||||
if (this._shellLaunchConfig.flowControl) {
|
||||
this._unacknowledgedCharCount += data.length;
|
||||
if (!this._isPtyPaused && this._unacknowledgedCharCount > FlowControlConstants.HighWatermarkChars) {
|
||||
this._logService.trace(`Flow control: Pause (${this._unacknowledgedCharCount} > ${FlowControlConstants.HighWatermarkChars})`);
|
||||
this._isPtyPaused = true;
|
||||
ptyProcess.pause();
|
||||
}
|
||||
// Handle flow control
|
||||
this._unacknowledgedCharCount += data.length;
|
||||
if (!this._isPtyPaused && this._unacknowledgedCharCount > FlowControlConstants.HighWatermarkChars) {
|
||||
this._logService.trace(`Flow control: Pause (${this._unacknowledgedCharCount} > ${FlowControlConstants.HighWatermarkChars})`);
|
||||
this._isPtyPaused = true;
|
||||
ptyProcess.pause();
|
||||
}
|
||||
|
||||
// Refire the data event
|
||||
this._onProcessData.fire(data);
|
||||
if (this._closeTimeout) {
|
||||
clearTimeout(this._closeTimeout);
|
||||
|
@ -369,9 +370,6 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
|
|||
}
|
||||
|
||||
public acknowledgeDataEvent(charCount: number): void {
|
||||
if (!this._shellLaunchConfig.flowControl) {
|
||||
return;
|
||||
}
|
||||
// Prevent lower than 0 to heal from errors
|
||||
this._unacknowledgedCharCount = Math.max(this._unacknowledgedCharCount - charCount, 0);
|
||||
this._logService.trace(`Flow control: Ack ${charCount} chars (unacknowledged: ${this._unacknowledgedCharCount})`);
|
||||
|
@ -383,10 +381,6 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
|
|||
}
|
||||
|
||||
public clearUnacknowledgedChars(): void {
|
||||
if (!this._shellLaunchConfig.flowControl) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._unacknowledgedCharCount = 0;
|
||||
this._logService.trace(`Flow control: Cleared all unacknowledged chars, forcing resume`);
|
||||
if (this._isPtyPaused) {
|
||||
|
|
|
@ -247,6 +247,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
|
|||
this._proxy.$acceptTerminalMaximumDimensions(instance.instanceId, instance.maxCols, instance.maxRows);
|
||||
}
|
||||
|
||||
|
||||
private _onRequestStartExtensionTerminal(request: IStartExtensionTerminalRequest): void {
|
||||
const proxy = request.proxy;
|
||||
this._terminalProcessProxies.set(proxy.instanceId, proxy);
|
||||
|
|
|
@ -1549,7 +1549,6 @@ export interface IShellLaunchConfigDto {
|
|||
cwd?: string | UriComponents;
|
||||
env?: { [key: string]: string | null; };
|
||||
hideFromUser?: boolean;
|
||||
flowControl?: boolean;
|
||||
}
|
||||
|
||||
export interface IShellDefinitionDto {
|
||||
|
|
|
@ -1030,9 +1030,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
|||
const messageId = ++this._latestXtermWriteData;
|
||||
this._xterm?.write(ev.data, () => {
|
||||
this._latestXtermParseData = messageId;
|
||||
if (this._shellLaunchConfig.flowControl) {
|
||||
this._processManager.acknowledgeDataEvent(ev.data.length);
|
||||
}
|
||||
this._processManager.acknowledgeDataEvent(ev.data.length);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,8 +119,8 @@ export class TerminalProcessExtHostProxy extends Disposable implements ITerminal
|
|||
this._onResize.fire({ cols, rows });
|
||||
}
|
||||
|
||||
public acknowledgeDataEvent(charCount: number): void {
|
||||
this._onAcknowledgeDataEvent.fire(charCount);
|
||||
public acknowledgeDataEvent(): void {
|
||||
// Flow control is disabled for extension terminals
|
||||
}
|
||||
|
||||
public getInitialCwd(): Promise<string> {
|
||||
|
|
|
@ -153,10 +153,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
|
|||
rows: number,
|
||||
isScreenReaderModeEnabled: boolean
|
||||
): Promise<ITerminalLaunchError | undefined> {
|
||||
shellLaunchConfig.flowControl = this._configHelper.config.flowControl;
|
||||
if (shellLaunchConfig.isExtensionCustomPtyTerminal) {
|
||||
// Flow control is not supported for extension terminals
|
||||
shellLaunchConfig.flowControl = false;
|
||||
this._processType = ProcessType.ExtensionTerminal;
|
||||
this._process = this._instantiationService.createInstance(TerminalProcessExtHostProxy, this._instanceId, shellLaunchConfig, cols, rows);
|
||||
} else {
|
||||
|
|
|
@ -55,7 +55,6 @@ export interface ICompleteTerminalConfiguration {
|
|||
'terminal.integrated.inheritEnv': boolean;
|
||||
'terminal.integrated.cwd': string;
|
||||
'terminal.integrated.detectLocale': 'auto' | 'off' | 'on';
|
||||
'terminal.flowControl': boolean;
|
||||
}
|
||||
|
||||
export type ITerminalEnvironmentVariableCollections = [string, ISerializableEnvironmentVariableCollection][];
|
||||
|
@ -241,8 +240,7 @@ export class RemoteTerminalChannelClient {
|
|||
'terminal.integrated.env.linux': this._readSingleTerminalConfiguration('terminal.integrated.env.linux'),
|
||||
'terminal.integrated.inheritEnv': terminalConfig.inheritEnv,
|
||||
'terminal.integrated.cwd': terminalConfig.cwd,
|
||||
'terminal.integrated.detectLocale': terminalConfig.detectLocale,
|
||||
'terminal.flowControl': terminalConfig.flowControl
|
||||
'terminal.integrated.detectLocale': terminalConfig.detectLocale
|
||||
};
|
||||
|
||||
// We will use the resolver service to resolve all the variables in the config / launch config
|
||||
|
|
|
@ -140,7 +140,6 @@ export interface ITerminalConfiguration {
|
|||
localEchoExcludePrograms: ReadonlyArray<string>;
|
||||
localEchoStyle: 'bold' | 'dim' | 'italic' | 'underlined' | 'inverted' | string;
|
||||
enablePersistentSessions: boolean;
|
||||
flowControl: boolean;
|
||||
}
|
||||
|
||||
export const DEFAULT_LOCAL_ECHO_EXCLUDE: ReadonlyArray<string> = ['vim', 'vi', 'nano', 'tmux'];
|
||||
|
|
|
@ -397,11 +397,6 @@ export const terminalConfiguration: IConfigurationNode = {
|
|||
description: localize('terminal.integrated.enablePersistentSessions', "Persist terminal sessions for the workspace across window reloads."),
|
||||
type: 'boolean',
|
||||
default: true
|
||||
},
|
||||
'terminal.integrated.flowControl': {
|
||||
description: localize('terminal.integrated.flowControl', "Experimental: whether to enable flow control which will slow the program on the remote side to avoid flooding remote connections with terminal output. This setting has no effect for local terminals and terminals where the output/input is controlled by an extension. Changing this will only affect new terminals."),
|
||||
type: 'boolean',
|
||||
default: true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue