mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-08 05:20:01 +00:00
fix(tabby-terminal): save icon/color/group/dynamic title/behavior on session end with 'Save As' Profile
This commit is contained in:
parent
4bbf86a7a7
commit
6709217a86
@ -174,27 +174,33 @@ export class SaveAsProfileContextMenu extends TabContextMenuItemProvider {
|
|||||||
click: async () => {
|
click: async () => {
|
||||||
const modal = this.ngbModal.open(PromptModalComponent)
|
const modal = this.ngbModal.open(PromptModalComponent)
|
||||||
modal.componentInstance.prompt = this.translate.instant('New profile name')
|
modal.componentInstance.prompt = this.translate.instant('New profile name')
|
||||||
|
modal.componentInstance.value = tab.profile.name
|
||||||
const name = (await modal.result)?.value
|
const name = (await modal.result)?.value
|
||||||
if (!name) {
|
if (!name) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let options = {...tab.profile.options}
|
let options = {
|
||||||
|
...tab.profile.options
|
||||||
|
}
|
||||||
|
|
||||||
const cwd = await tab.session?.getWorkingDirectory() ?? tab.profile.options.cwd
|
const cwd = await tab.session?.getWorkingDirectory() ?? tab.profile.options.cwd
|
||||||
if (cwd) {
|
if (cwd) {
|
||||||
options = {
|
options.cwd = cwd
|
||||||
...options,
|
|
||||||
cwd
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const profile: PartialProfile<Profile> = {
|
const profile: PartialProfile<Profile> = {
|
||||||
options,
|
|
||||||
name,
|
|
||||||
type: tab.profile.type,
|
type: tab.profile.type,
|
||||||
|
name,
|
||||||
|
options
|
||||||
}
|
}
|
||||||
|
|
||||||
profile.id = `${profile.type}:custom:${slugify(profile.name)}:${uuidv4()}`
|
profile.id = `${profile.type}:custom:${slugify(name)}:${uuidv4()}`
|
||||||
|
profile.group = tab.profile.group
|
||||||
|
profile.icon = tab.profile.icon
|
||||||
|
profile.color = tab.profile.color
|
||||||
|
profile.disableDynamicTitle = tab.profile.disableDynamicTitle
|
||||||
|
profile.behaviorOnSessionEnd = tab.profile.behaviorOnSessionEnd
|
||||||
|
|
||||||
this.config.store.profiles = [
|
this.config.store.profiles = [
|
||||||
...this.config.store.profiles,
|
...this.config.store.profiles,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user