Skip to content

Commit

Permalink
fixed #3862 - option to close the window when closing all tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Oct 25, 2022
1 parent 7ed7ec3 commit 0ea2adf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions tabby-core/src/configDefaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ appearance:
opacity: 1.0
vibrancy: false
vibrancyType: 'blur'
lastTabClosesWindow: false
terminal:
showBuiltinProfiles: true
showRecentProfiles: 3
Expand Down
6 changes: 6 additions & 0 deletions tabby-core/src/services/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down
9 changes: 9 additions & 0 deletions tabby-settings/src/components/windowSettingsTab.component.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 0ea2adf

Please sign in to comment.