Browse Source

fixed #3862 - option to close the window when closing all tabs

Eugene Pankov 3 years ago
parent
commit
0ea2adf6c8

+ 1 - 0
tabby-core/src/configDefaults.yaml

@@ -16,6 +16,7 @@ appearance:
   opacity: 1.0
   vibrancy: false
   vibrancyType: 'blur'
+  lastTabClosesWindow: false
 terminal:
   showBuiltinProfiles: true
   showRecentProfiles: 3

+ 6 - 0
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())
     }
 

+ 9 - 0
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()