Skip to content

Commit 40f6286

Browse files
committed
fix: git is force opening the terminal on app reloads
1 parent eafe068 commit 40f6286

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

src/extensions/default/Git/src/Panel.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,16 @@ define(function (require, exports) {
13581358

13591359
// Show gitPanel when appropriate
13601360
if (Preferences.get("panelEnabled") && Setup.isExtensionActivated()) {
1361-
toggle(true);
1361+
// If the bottom panel container is collapsed, just add the Git tab
1362+
// without forcing it open. The user collapsed it intentionally.
1363+
const $container = $("#bottom-panel-container");
1364+
if ($container.is(":visible")) {
1365+
toggle(true);
1366+
} else {
1367+
gitPanel.addToTabBar();
1368+
$("#git-toolbar-icon").removeClass("forced-hidden");
1369+
refresh();
1370+
}
13621371
}
13631372
_panelResized();
13641373
GutterManager.init();
@@ -1515,6 +1524,7 @@ define(function (require, exports) {
15151524
if (panelID === WorkspaceManager.DEFAULT_PANEL_ID && Main.$icon) {
15161525
Main.$icon.toggleClass("on", false);
15171526
Main.$icon.toggleClass("selected-button", false);
1527+
CommandManager.get(Constants.CMD_GIT_TOGGLE_PANEL).setChecked(false);
15181528
}
15191529
});
15201530

@@ -1524,6 +1534,7 @@ define(function (require, exports) {
15241534
if (Main.$icon && Preferences.get("panelEnabled")) {
15251535
Main.$icon.toggleClass("on", true);
15261536
Main.$icon.toggleClass("selected-button", true);
1537+
CommandManager.get(Constants.CMD_GIT_TOGGLE_PANEL).setChecked(true);
15271538
}
15281539
});
15291540

src/view/PanelView.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,19 @@ define(function (require, exports, module) {
731731
exports.trigger(EVENT_PANEL_SHOWN, panelId);
732732
};
733733

734+
/**
735+
* Adds the panel to the tab bar and open set without showing the container.
736+
* Use this during startup to restore a panel's tab when the container
737+
* was collapsed by the user — avoids forcing the bottom panel open.
738+
*/
739+
Panel.prototype.addToTabBar = function () {
740+
if (!_$container || _openIds.indexOf(this.panelID) !== -1) {
741+
return;
742+
}
743+
_openIds.push(this.panelID);
744+
_addTabToBar(this.panelID);
745+
};
746+
734747
/**
735748
* Hides the panel
736749
*/

0 commit comments

Comments
 (0)