diff --git a/src/vs/workbench/api/common/extHostTerminalService.ts b/src/vs/workbench/api/common/extHostTerminalService.ts index 1573b96578b..d527f1eba1b 100644 --- a/src/vs/workbench/api/common/extHostTerminalService.ts +++ b/src/vs/workbench/api/common/extHostTerminalService.ts @@ -167,7 +167,8 @@ export class ExtHostTerminal { isExtensionCustomPtyTerminal: true, icon: iconPath, color: ThemeColor.isThemeColor(color) ? color.id : undefined, - location: this._serializeParentTerminal(location, parentTerminal) + location: this._serializeParentTerminal(location, parentTerminal), + disablePersistence: true }); // At this point, the id has been set via `$acceptTerminalOpened` if (typeof this._id === 'string') { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalEditorSerializer.ts b/src/vs/workbench/contrib/terminal/browser/terminalEditorSerializer.ts index e8f31f5c479..e49def31ff0 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalEditorSerializer.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalEditorSerializer.ts @@ -21,7 +21,7 @@ export class TerminalInputSerializer implements IEditorSerializer { } public serialize(editorInput: TerminalEditorInput): string | undefined { - if (!editorInput.terminalInstance?.persistentProcessId) { + if (!editorInput.terminalInstance?.persistentProcessId || !editorInput.terminalInstance.shouldPersist) { return; } const term = JSON.stringify(this._toJson(editorInput.terminalInstance)); diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index b9a34618336..8b99157ebe0 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -330,7 +330,6 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { this._titleReadyPromise = new Promise(c => { this._titleReadyComplete = c; }); - this._fixedRows = _shellLaunchConfig.attachPersistentProcess?.fixedDimensions?.rows; this._fixedCols = _shellLaunchConfig.attachPersistentProcess?.fixedDimensions?.cols; this._icon = _shellLaunchConfig.attachPersistentProcess?.icon || _shellLaunchConfig.icon; @@ -550,7 +549,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { } get persistentProcessId(): number | undefined { return this._processManager.persistentProcessId; } - get shouldPersist(): boolean { return this._processManager.shouldPersist; } + get shouldPersist(): boolean { return this._processManager.shouldPersist && !this.shellLaunchConfig.disablePersistence; } /** * Create xterm.js instance and attach data listeners.