diff --git a/tabby-core/src/configDefaults.yaml b/tabby-core/src/configDefaults.yaml index a4cd8be9..8a2bbf02 100644 --- a/tabby-core/src/configDefaults.yaml +++ b/tabby-core/src/configDefaults.yaml @@ -16,6 +16,7 @@ appearance: opacity: 1.0 vibrancy: false vibrancyType: 'blur' + lastTabClosesWindow: false terminal: showBuiltinProfiles: true showRecentProfiles: 3 diff --git a/tabby-core/src/services/app.service.ts b/tabby-core/src/services/app.service.ts index 324e8574..ab4786ab 100644 --- a/tabby-core/src/services/app.service.ts +++ b/tabby-core/src/services/app.service.ts @@ -107,6 +107,12 @@ export class AppService { } }) + this.tabClosed$.subscribe(() => { + if (!this.tabs.length && this.config.store.appearance.lastTabClosesWindow) { + this.hostWindow.close() + } + }) + hostWindow.windowFocused$.subscribe(() => this._activeTab?.emitFocused()) } diff --git a/tabby-settings/src/components/windowSettingsTab.component.pug b/tabby-settings/src/components/windowSettingsTab.component.pug index bf46bacf..393c8016 100644 --- a/tabby-settings/src/components/windowSettingsTab.component.pug +++ b/tabby-settings/src/components/windowSettingsTab.component.pug @@ -313,6 +313,15 @@ h3.mt-4(translate) Tabs (ngModelChange)='config.save();', ) +.form-line + .header + .title(translate) Close the window after closing the last tab + + toggle( + [(ngModel)]='config.store.appearance.lastTabClosesWindow', + (ngModelChange)='config.save();', + ) + h3.mt-4(translate) Panes .form-line()