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

Fix bug where terminal name wasn't being set on first instance

上级 9d16f3c1
......@@ -30,6 +30,7 @@ export class TerminalService implements ITerminalService {
private activeTerminalIndex: number = 0;
private terminalProcesses: ITerminalProcess[] = [];
private nextTerminalName: string;
protected _terminalFocusContextKey: IContextKey<boolean>;
private configHelper: TerminalConfigHelper;
......@@ -156,6 +157,13 @@ export class TerminalService implements ITerminalService {
let self = this;
let processCount = this.terminalProcesses.length;
// When there are 0 processes it means that the panel is not yet created, so the name needs
// to be stored for when createNew is called from TerminalPanel.create.
if (processCount === 0 && !name) {
name = this.nextTerminalName;
}
this.nextTerminalName = name;
return this.focus().then((terminalPanel) => {
// terminalPanel will be null if createNew is called from the command before the
// TerminalPanel has been initialized. In this case, skip creating the terminal here
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册