mirror of
https://github.com/Eugeny/tabby
synced 2024-11-15 17:28:06 +00:00
Issue #1549 Add option to disable tab restore on startup
This commit is contained in:
commit
de0db8b7a5
3 changed files with 29 additions and 10 deletions
|
@ -71,20 +71,29 @@ export class AppService {
|
||||||
private tabsService: TabsService,
|
private tabsService: TabsService,
|
||||||
) {
|
) {
|
||||||
if (hostApp.getWindow().id === 1) {
|
if (hostApp.getWindow().id === 1) {
|
||||||
this.tabRecovery.recoverTabs().then(tabs => {
|
if (config.store.terminal.recoverTabs) {
|
||||||
for (const tab of tabs) {
|
this.tabRecovery.recoverTabs().then(tabs => {
|
||||||
this.openNewTabRaw(tab.type, tab.options)
|
for (const tab of tabs) {
|
||||||
}
|
this.openNewTabRaw(tab.type, tab.options)
|
||||||
this.tabsChanged$.subscribe(() => {
|
}
|
||||||
tabRecovery.saveTabs(this.tabs)
|
this.startTabStorage()
|
||||||
})
|
})
|
||||||
setInterval(() => {
|
} else {
|
||||||
tabRecovery.saveTabs(this.tabs)
|
/** Continue to store the tabs even if the setting is currently off */
|
||||||
}, 30000)
|
this.startTabStorage()
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startTabStorage() {
|
||||||
|
this.tabsChanged$.subscribe(() => {
|
||||||
|
this.tabRecovery.saveTabs(this.tabs)
|
||||||
|
})
|
||||||
|
setInterval(() => {
|
||||||
|
this.tabRecovery.saveTabs(this.tabs)
|
||||||
|
}, 30000)
|
||||||
|
}
|
||||||
|
|
||||||
addTabRaw (tab: BaseTabComponent) {
|
addTabRaw (tab: BaseTabComponent) {
|
||||||
this.tabs.push(tab)
|
this.tabs.push(tab)
|
||||||
this.selectTab(tab)
|
this.selectTab(tab)
|
||||||
|
|
|
@ -66,6 +66,15 @@ h3.mb-3 Terminal
|
||||||
(ngModelChange)='config.save()',
|
(ngModelChange)='config.save()',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
.form-line
|
||||||
|
.header
|
||||||
|
.title Restore terminal tabs on app start
|
||||||
|
|
||||||
|
toggle(
|
||||||
|
[(ngModel)]='config.store.terminal.recoverTabs',
|
||||||
|
(ngModelChange)='config.save()',
|
||||||
|
)
|
||||||
|
|
||||||
.form-line
|
.form-line
|
||||||
.header
|
.header
|
||||||
.title Bracketed paste (requires shell support)
|
.title Bracketed paste (requires shell support)
|
||||||
|
|
|
@ -59,6 +59,7 @@ export class TerminalConfigProvider extends ConfigProvider {
|
||||||
environment: {},
|
environment: {},
|
||||||
profiles: [],
|
profiles: [],
|
||||||
useConPTY: true,
|
useConPTY: true,
|
||||||
|
recoverTabs: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue