mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-24 09:06:03 +00:00
fixed #4586 - fix disableDynamicTabTitle to work with switch-profile
This commit is contained in:
@@ -483,6 +483,7 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
|
|||||||
newTab.parent = this
|
newTab.parent = this
|
||||||
this.recoveryStateChangedHint.next()
|
this.recoveryStateChangedHint.next()
|
||||||
this.onAfterTabAdded(newTab)
|
this.onAfterTabAdded(newTab)
|
||||||
|
this.updateTitle()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -37,13 +37,6 @@ export class ProfilesService {
|
|||||||
if (params) {
|
if (params) {
|
||||||
const tab = this.app.openNewTab(params)
|
const tab = this.app.openNewTab(params)
|
||||||
;(this.app.getParentTab(tab) ?? tab).color = profile.color ?? null
|
;(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 tab
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
@@ -51,7 +44,15 @@ export class ProfilesService {
|
|||||||
|
|
||||||
async newTabParametersForProfile <P extends Profile> (profile: PartialProfile<P>): Promise<NewTabParameters<BaseTabComponent>|null> {
|
async newTabParametersForProfile <P extends Profile> (profile: PartialProfile<P>): Promise<NewTabParameters<BaseTabComponent>|null> {
|
||||||
const fullProfile = this.getConfigProxyForProfile(profile)
|
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>[] {
|
getProviders (): ProfileProvider<Profile>[] {
|
||||||
|
Reference in New Issue
Block a user