Reconnect scrollback setting
This commit is contained in:
parent
00c826c0b9
commit
9fbffef8b8
6 changed files with 34 additions and 15 deletions
|
@ -68,7 +68,7 @@ import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService'
|
||||||
import { combinedAppender, ITelemetryAppender, NullAppender, NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
|
import { combinedAppender, ITelemetryAppender, NullAppender, NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||||
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender';
|
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender';
|
||||||
import { CustomEndpointTelemetryService } from 'vs/platform/telemetry/node/customEndpointTelemetryService';
|
import { CustomEndpointTelemetryService } from 'vs/platform/telemetry/node/customEndpointTelemetryService';
|
||||||
import { LocalReconnectConstants, TerminalIpcChannels } from 'vs/platform/terminal/common/terminal';
|
import { LocalReconnectConstants, TerminalIpcChannels, TerminalSettingId } from 'vs/platform/terminal/common/terminal';
|
||||||
import { ILocalPtyService } from 'vs/platform/terminal/electron-sandbox/terminal';
|
import { ILocalPtyService } from 'vs/platform/terminal/electron-sandbox/terminal';
|
||||||
import { PtyHostService } from 'vs/platform/terminal/node/ptyHostService';
|
import { PtyHostService } from 'vs/platform/terminal/node/ptyHostService';
|
||||||
import { ExtensionsStorageSyncService, IExtensionsStorageSyncService } from 'vs/platform/userDataSync/common/extensionsStorageSync';
|
import { ExtensionsStorageSyncService, IExtensionsStorageSyncService } from 'vs/platform/userDataSync/common/extensionsStorageSync';
|
||||||
|
@ -276,8 +276,9 @@ class SharedProcessMain extends Disposable {
|
||||||
ILocalPtyService,
|
ILocalPtyService,
|
||||||
this._register(
|
this._register(
|
||||||
new PtyHostService({
|
new PtyHostService({
|
||||||
GraceTime: LocalReconnectConstants.GraceTime,
|
graceTime: LocalReconnectConstants.GraceTime,
|
||||||
ShortGraceTime: LocalReconnectConstants.ShortGraceTime
|
shortGraceTime: LocalReconnectConstants.ShortGraceTime,
|
||||||
|
scrollback: configurationService.getValue<number>(TerminalSettingId.PersistentSessionScrollback) || 1
|
||||||
},
|
},
|
||||||
configurationService,
|
configurationService,
|
||||||
logService,
|
logService,
|
||||||
|
|
|
@ -89,6 +89,7 @@ export const enum TerminalSettingId {
|
||||||
LocalEchoExcludePrograms = 'terminal.integrated.localEchoExcludePrograms',
|
LocalEchoExcludePrograms = 'terminal.integrated.localEchoExcludePrograms',
|
||||||
LocalEchoStyle = 'terminal.integrated.localEchoStyle',
|
LocalEchoStyle = 'terminal.integrated.localEchoStyle',
|
||||||
EnablePersistentSessions = 'terminal.integrated.enablePersistentSessions',
|
EnablePersistentSessions = 'terminal.integrated.enablePersistentSessions',
|
||||||
|
PersistentSessionScrollback = 'terminal.integrated.persistentSessionScrollback',
|
||||||
InheritEnv = 'terminal.integrated.inheritEnv',
|
InheritEnv = 'terminal.integrated.inheritEnv',
|
||||||
ShowLinkHover = 'terminal.integrated.showLinkHover',
|
ShowLinkHover = 'terminal.integrated.showLinkHover',
|
||||||
}
|
}
|
||||||
|
@ -489,8 +490,9 @@ export interface ITerminalChildProcess {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IReconnectConstants {
|
export interface IReconnectConstants {
|
||||||
GraceTime: number,
|
graceTime: number;
|
||||||
ShortGraceTime: number
|
shortGraceTime: number;
|
||||||
|
scrollback: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const enum LocalReconnectConstants {
|
export const enum LocalReconnectConstants {
|
||||||
|
|
|
@ -360,6 +360,12 @@ const terminalPlatformConfiguration: IConfigurationNode = {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
|
[TerminalSettingId.PersistentSessionScrollback]: {
|
||||||
|
scope: ConfigurationScope.APPLICATION,
|
||||||
|
markdownDescription: localize('terminal.integrated.persistentSessionScrollback', "Controls the maximum amount of lines that will be restored when reconnecting to a persistent terminal session. Increasing this will restore more lines of scrollback at the cost of more memory and increase the time it takes to connect to terminals on start up. This setting requires a restart to take effect and should be set to a value less than or equal to `#terminal.integrated.scrollback#`."),
|
||||||
|
type: 'number',
|
||||||
|
default: 100
|
||||||
|
},
|
||||||
[TerminalSettingId.ShowLinkHover]: {
|
[TerminalSettingId.ShowLinkHover]: {
|
||||||
scope: ConfigurationScope.APPLICATION,
|
scope: ConfigurationScope.APPLICATION,
|
||||||
description: localize('terminal.integrated.showLinkHover', "Whether to show hovers for links in the terminal output."),
|
description: localize('terminal.integrated.showLinkHover', "Whether to show hovers for links in the terminal output."),
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||||
import { Server } from 'vs/base/parts/ipc/node/ipc.cp';
|
import { Server } from 'vs/base/parts/ipc/node/ipc.cp';
|
||||||
import { ConsoleLogger, LogService } from 'vs/platform/log/common/log';
|
import { ConsoleLogger, LogService } from 'vs/platform/log/common/log';
|
||||||
import { LogLevelChannel } from 'vs/platform/log/common/logIpc';
|
import { LogLevelChannel } from 'vs/platform/log/common/logIpc';
|
||||||
import { TerminalIpcChannels } from 'vs/platform/terminal/common/terminal';
|
import { IReconnectConstants, TerminalIpcChannels } from 'vs/platform/terminal/common/terminal';
|
||||||
import { HeartbeatService } from 'vs/platform/terminal/node/heartbeatService';
|
import { HeartbeatService } from 'vs/platform/terminal/node/heartbeatService';
|
||||||
import { PtyService } from 'vs/platform/terminal/node/ptyService';
|
import { PtyService } from 'vs/platform/terminal/node/ptyService';
|
||||||
|
|
||||||
|
@ -23,9 +23,14 @@ server.registerChannel(TerminalIpcChannels.Log, logChannel);
|
||||||
const heartbeatService = new HeartbeatService();
|
const heartbeatService = new HeartbeatService();
|
||||||
server.registerChannel(TerminalIpcChannels.Heartbeat, ProxyChannel.fromService(heartbeatService));
|
server.registerChannel(TerminalIpcChannels.Heartbeat, ProxyChannel.fromService(heartbeatService));
|
||||||
|
|
||||||
const reconnectConstants = { GraceTime: parseInt(process.env.VSCODE_RECONNECT_GRACE_TIME || '0'), ShortGraceTime: parseInt(process.env.VSCODE_RECONNECT_SHORT_GRACE_TIME || '0') };
|
const reconnectConstants: IReconnectConstants = {
|
||||||
|
graceTime: parseInt(process.env.VSCODE_RECONNECT_GRACE_TIME || '0'),
|
||||||
|
shortGraceTime: parseInt(process.env.VSCODE_RECONNECT_SHORT_GRACE_TIME || '0'),
|
||||||
|
scrollback: parseInt(process.env.VSCODE_RECONNECT_SCROLLBACK || '100'),
|
||||||
|
};
|
||||||
delete process.env.VSCODE_RECONNECT_GRACE_TIME;
|
delete process.env.VSCODE_RECONNECT_GRACE_TIME;
|
||||||
delete process.env.VSCODE_RECONNECT_SHORT_GRACE_TIME;
|
delete process.env.VSCODE_RECONNECT_SHORT_GRACE_TIME;
|
||||||
|
delete process.env.VSCODE_RECONNECT_SCROLLBACK;
|
||||||
|
|
||||||
const ptyService = new PtyService(lastPtyId, logService, reconnectConstants);
|
const ptyService = new PtyService(lastPtyId, logService, reconnectConstants);
|
||||||
server.registerChannel(TerminalIpcChannels.PtyHost, ProxyChannel.fromService(ptyService));
|
server.registerChannel(TerminalIpcChannels.PtyHost, ProxyChannel.fromService(ptyService));
|
||||||
|
|
|
@ -117,8 +117,9 @@ export class PtyHostService extends Disposable implements IPtyService {
|
||||||
VSCODE_AMD_ENTRYPOINT: 'vs/platform/terminal/node/ptyHostMain',
|
VSCODE_AMD_ENTRYPOINT: 'vs/platform/terminal/node/ptyHostMain',
|
||||||
VSCODE_PIPE_LOGGING: 'true',
|
VSCODE_PIPE_LOGGING: 'true',
|
||||||
VSCODE_VERBOSE_LOGGING: 'true', // transmit console logs from server to client,
|
VSCODE_VERBOSE_LOGGING: 'true', // transmit console logs from server to client,
|
||||||
VSCODE_RECONNECT_GRACE_TIME: this._reconnectConstants.GraceTime,
|
VSCODE_RECONNECT_GRACE_TIME: this._reconnectConstants.graceTime,
|
||||||
VSCODE_RECONNECT_SHORT_GRACE_TIME: this._reconnectConstants.ShortGraceTime
|
VSCODE_RECONNECT_SHORT_GRACE_TIME: this._reconnectConstants.shortGraceTime,
|
||||||
|
VSCODE_RECONNECT_SCROLLBACK: this._reconnectConstants.scrollback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -373,18 +373,22 @@ export class PersistentTerminalProcess extends Disposable {
|
||||||
super();
|
super();
|
||||||
this._logService.trace('persistentTerminalProcess#ctor', _persistentProcessId, arguments);
|
this._logService.trace('persistentTerminalProcess#ctor', _persistentProcessId, arguments);
|
||||||
|
|
||||||
this._xterm = new Terminal({ cols, rows });
|
this._xterm = new Terminal({
|
||||||
|
cols,
|
||||||
|
rows,
|
||||||
|
scrollback: reconnectConstants.scrollback
|
||||||
|
});
|
||||||
this._recorder = new TerminalRecorder(cols, rows);
|
this._recorder = new TerminalRecorder(cols, rows);
|
||||||
this._orphanQuestionBarrier = null;
|
this._orphanQuestionBarrier = null;
|
||||||
this._orphanQuestionReplyTime = 0;
|
this._orphanQuestionReplyTime = 0;
|
||||||
this._disconnectRunner1 = this._register(new RunOnceScheduler(() => {
|
this._disconnectRunner1 = this._register(new RunOnceScheduler(() => {
|
||||||
this._logService.info(`Persistent process "${this._persistentProcessId}": The reconnection grace time of ${printTime(reconnectConstants.GraceTime)} has expired, shutting down pid "${this._pid}"`);
|
this._logService.info(`Persistent process "${this._persistentProcessId}": The reconnection grace time of ${printTime(reconnectConstants.graceTime)} has expired, shutting down pid "${this._pid}"`);
|
||||||
this.shutdown(true);
|
this.shutdown(true);
|
||||||
}, reconnectConstants.GraceTime));
|
}, reconnectConstants.graceTime));
|
||||||
this._disconnectRunner2 = this._register(new RunOnceScheduler(() => {
|
this._disconnectRunner2 = this._register(new RunOnceScheduler(() => {
|
||||||
this._logService.info(`Persistent process "${this._persistentProcessId}": The short reconnection grace time of ${printTime(reconnectConstants.ShortGraceTime)} has expired, shutting down pid ${this._pid}`);
|
this._logService.info(`Persistent process "${this._persistentProcessId}": The short reconnection grace time of ${printTime(reconnectConstants.shortGraceTime)} has expired, shutting down pid ${this._pid}`);
|
||||||
this.shutdown(true);
|
this.shutdown(true);
|
||||||
}, reconnectConstants.ShortGraceTime));
|
}, reconnectConstants.shortGraceTime));
|
||||||
|
|
||||||
this._register(this._terminalProcess.onProcessReady(e => {
|
this._register(this._terminalProcess.onProcessReady(e => {
|
||||||
this._pid = e.pid;
|
this._pid = e.pid;
|
||||||
|
@ -490,7 +494,7 @@ export class PersistentTerminalProcess extends Disposable {
|
||||||
}
|
}
|
||||||
const serialize = new SerializeAddon();
|
const serialize = new SerializeAddon();
|
||||||
this._xterm.loadAddon(serialize);
|
this._xterm.loadAddon(serialize);
|
||||||
const serialized = serialize.serialize(100);
|
const serialized = serialize.serialize(this._xterm.getOption('scrollback'));
|
||||||
this._logService.info('serialized', serialized);
|
this._logService.info('serialized', serialized);
|
||||||
// this._onProcessReplay.fire(ev);
|
// this._onProcessReplay.fire(ev);
|
||||||
this._onProcessReplay.fire({
|
this._onProcessReplay.fire({
|
||||||
|
|
Loading…
Reference in a new issue