未验证 提交 268e9dae 编写于 作者: D Daniel Imms 提交者: GitHub

Merge pull request #128650 from microsoft/tyriar/r158_128255

Unset active terminal group when last is removed
......@@ -238,9 +238,22 @@ export class TerminalGroupService extends Disposable implements ITerminalGroupSe
* group has been removed.
*/
setActiveGroupByIndex(index: number, force?: boolean) {
// Unset active group when the last group is removed
if (index === -1 && this.groups.length === 0) {
if (this.activeGroupIndex !== -1) {
this.activeGroupIndex = -1;
this._onDidChangeActiveGroup.fire(this.activeGroup);
this._onDidChangeActiveInstance.fire(this.activeInstance);
}
return;
}
// Ensure index is valid
if (index < 0 || index >= this.groups.length) {
return;
}
// Fire group/instance change if needed
const oldActiveGroup = this.activeGroup;
this.activeGroupIndex = index;
if (force || oldActiveGroup !== this.activeGroup) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册