提交 e39b1f07 编写于 作者: D Daniel Imms

Remove terminal experimental restore setting

Part of #44302
上级 5ef09f9f
......@@ -97,7 +97,6 @@ export interface ITerminalConfiguration {
windows: { [key: string]: string };
};
showExitAlert: boolean;
experimentalRestore: boolean;
}
export interface ITerminalConfigHelper {
......
......@@ -6,14 +6,12 @@
import * as errors from 'vs/base/common/errors';
import { Event, Emitter } from 'vs/base/common/event';
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { ITerminalService, ITerminalInstance, IShellLaunchConfig, ITerminalConfigHelper, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE, TERMINAL_PANEL_ID, ITerminalTab, ITerminalProcessExtHostProxy, ITerminalProcessExtHostRequest, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN } from 'vs/workbench/parts/terminal/common/terminal';
import { TPromise } from 'vs/base/common/winjs.base';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
const TERMINAL_STATE_STORAGE_KEY = 'terminal.state';
import { IStorageService } from 'vs/platform/storage/common/storage';
export abstract class TerminalService implements ITerminalService {
public _serviceBrand: any;
......@@ -70,8 +68,6 @@ export abstract class TerminalService implements ITerminalService {
this._findWidgetVisible = KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE.bindTo(this._contextKeyService);
this.onTabDisposed(tab => this._removeTab(tab));
lifecycleService.when(LifecyclePhase.Restoring).then(() => this._restoreTabs());
this._handleContextKeys();
}
......@@ -94,29 +90,6 @@ export abstract class TerminalService implements ITerminalService {
public abstract setContainers(panelContainer: HTMLElement, terminalContainer: HTMLElement): void;
public abstract requestExtHostProcess(proxy: ITerminalProcessExtHostProxy, shellLaunchConfig: IShellLaunchConfig, cols: number, rows: number): void;
private _restoreTabs(): void {
if (!this.configHelper.config.experimentalRestore) {
return;
}
const tabConfigsJson = this._storageService.get(TERMINAL_STATE_STORAGE_KEY, StorageScope.WORKSPACE);
if (!tabConfigsJson) {
return;
}
const tabConfigs = <{ instances: IShellLaunchConfig[] }[]>JSON.parse(tabConfigsJson);
if (!Array.isArray(tabConfigs)) {
return;
}
tabConfigs.forEach(tabConfig => {
const instance = this.createTerminal(tabConfig.instances[0]);
for (let i = 1; i < tabConfig.instances.length; i++) {
this.splitInstance(instance, tabConfig.instances[i]);
}
});
}
private _onWillShutdown(): boolean | TPromise<boolean> {
if (this.terminalInstances.length === 0) {
// No terminal instances, don't veto
......@@ -139,16 +112,6 @@ export abstract class TerminalService implements ITerminalService {
}
private _onShutdown(): void {
// Store terminal tab layout
if (this.configHelper.config.experimentalRestore) {
const configs = this.terminalTabs.map(tab => {
return {
instances: tab.terminalInstances.map(instance => instance.shellLaunchConfig)
};
});
this._storageService.store(TERMINAL_STATE_STORAGE_KEY, JSON.stringify(configs), StorageScope.WORKSPACE);
}
// Dispose of all instances
this.terminalInstances.forEach(instance => instance.dispose());
}
......
......@@ -356,11 +356,6 @@ configurationRegistry.registerConfiguration({
description: nls.localize('terminal.integrated.showExitAlert', "Controls whether to show the alert \"The terminal process terminated with exit code\" when exit code is non-zero."),
type: 'boolean',
default: true
},
'terminal.integrated.experimentalRestore': {
description: nls.localize('terminal.integrated.experimentalRestore', "Controls whether to restore terminal sessions for the workspace automatically when launching VS Code. This is an experimental setting; it may be buggy and could change or be removed in the future."),
type: 'boolean',
default: false
}
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册