未验证 提交 cbad6f91 编写于 作者: M meganrogge

fix #129622

上级 e561330b
......@@ -95,6 +95,7 @@ export class TerminalEditor extends EditorPane {
// panel and the editors, this is needed so that the active instance gets set
// when focus changes between them.
this._register(this._editorInput.terminalInstance.onDidFocus(() => this._setActiveInstance()));
this._editorInput.setCopyLaunchConfig(this._editorInput.terminalInstance.shellLaunchConfig);
}
}
......
......@@ -12,7 +12,7 @@ import { ITerminalInstance, ITerminalInstanceService } from 'vs/workbench/contri
import { TerminalEditor } from 'vs/workbench/contrib/terminal/browser/terminalEditor';
import { getColorClass, getUriClasses } from 'vs/workbench/contrib/terminal/browser/terminalIcon';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { TerminalLocation, TerminalSettingId } from 'vs/platform/terminal/common/terminal';
import { IShellLaunchConfig, TerminalLocation, TerminalSettingId } from 'vs/platform/terminal/common/terminal';
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle';
import { ConfirmOnKill } from 'vs/workbench/contrib/terminal/common/terminal';
......@@ -31,7 +31,7 @@ export class TerminalEditorInput extends EditorInput {
private _isDetached = false;
private _isShuttingDown = false;
private _isReverted = false;
private _copyInstance?: ITerminalInstance;
private _copyLaunchConfig?: IShellLaunchConfig;
private _terminalEditorFocusContextKey: IContextKey<boolean>;
private _group: IEditorGroup | undefined;
......@@ -68,18 +68,18 @@ export class TerminalEditorInput extends EditorInput {
}
override copy(): IEditorInput {
const instance = this._copyInstance || this._terminalInstanceService.createInstance({}, TerminalLocation.Editor);
const instance = this._terminalInstanceService.createInstance(this._copyLaunchConfig || {}, TerminalLocation.Editor);
instance.focusWhenReady();
this._copyInstance = undefined;
this._copyLaunchConfig = undefined;
return this._instantiationService.createInstance(TerminalEditorInput, instance.resource, instance);
}
/**
* Sets what instance to use for the next call to IEditorInput.copy, this is used to define what
* terminal instance is used when the editor's split command is run.
* Sets the launch config to use for the next call to IEditorInput.copy, which will be used when
* the editor's split command is run.
*/
setCopyInstance(instance: ITerminalInstance) {
this._copyInstance = instance;
setCopyLaunchConfig(launchConfig: IShellLaunchConfig) {
this._copyLaunchConfig = launchConfig;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册