1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-10-06 09:27:20 +03:00

fixed #4586 - fix disableDynamicTabTitle to work with switch-profile

This commit is contained in:
Eugene Pankov 2021-09-24 23:55:19 +02:00
parent ed71b499b9
commit 3923e46f22
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
2 changed files with 10 additions and 8 deletions

View File

@ -483,6 +483,7 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
newTab.parent = this
this.recoveryStateChangedHint.next()
this.onAfterTabAdded(newTab)
this.updateTitle()
}
/**

View File

@ -37,13 +37,6 @@ export class ProfilesService {
if (params) {
const tab = this.app.openNewTab(params)
;(this.app.getParentTab(tab) ?? tab).color = profile.color ?? null
if (profile.name) {
tab.setTitle(profile.name)
}
if (profile.disableDynamicTitle) {
tab['disableDynamicTitle'] = true
}
return tab
}
return null
@ -51,7 +44,15 @@ export class ProfilesService {
async newTabParametersForProfile <P extends Profile> (profile: PartialProfile<P>): Promise<NewTabParameters<BaseTabComponent>|null> {
const fullProfile = this.getConfigProxyForProfile(profile)
return this.providerForProfile(fullProfile)?.getNewTabParameters(fullProfile) ?? null
const params = await this.providerForProfile(fullProfile)?.getNewTabParameters(fullProfile) ?? null
if (params) {
params.inputs ??= {}
params.inputs['title'] = profile.name
if (profile.disableDynamicTitle) {
params.inputs['disableDynamicTitle'] = true
}
}
return params
}
getProviders (): ProfileProvider<Profile>[] {