mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 18:38:01 +00:00
fixed #4230 - option to limit or disable "recent profiles"
This commit is contained in:
@@ -36,10 +36,12 @@ export class ButtonProvider extends ToolbarButtonProvider {
|
|||||||
await this.profilesService.openNewTabForProfile(profile)
|
await this.profilesService.openNewTabForProfile(profile)
|
||||||
|
|
||||||
let recentProfiles = this.config.store.recentProfiles
|
let recentProfiles = this.config.store.recentProfiles
|
||||||
|
if (this.config.store.terminal.showRecentProfiles > 0) {
|
||||||
recentProfiles = recentProfiles.filter(x => x.group !== profile.group || x.name !== profile.name)
|
recentProfiles = recentProfiles.filter(x => x.group !== profile.group || x.name !== profile.name)
|
||||||
recentProfiles.unshift(profile)
|
recentProfiles.unshift(profile)
|
||||||
if (recentProfiles.length > 5) {
|
recentProfiles = recentProfiles.slice(0, this.config.store.terminal.showRecentProfiles)
|
||||||
recentProfiles.pop()
|
} else {
|
||||||
|
recentProfiles = []
|
||||||
}
|
}
|
||||||
this.config.store.recentProfiles = recentProfiles
|
this.config.store.recentProfiles = recentProfiles
|
||||||
this.config.save()
|
this.config.save()
|
||||||
|
@@ -16,6 +16,7 @@ appearance:
|
|||||||
vibrancyType: 'blur'
|
vibrancyType: 'blur'
|
||||||
terminal:
|
terminal:
|
||||||
showBuiltinProfiles: true
|
showBuiltinProfiles: true
|
||||||
|
showRecentProfiles: 3
|
||||||
hotkeys:
|
hotkeys:
|
||||||
profile:
|
profile:
|
||||||
__nonStructural: true
|
__nonStructural: true
|
||||||
|
@@ -93,7 +93,8 @@ export class ProfilesService {
|
|||||||
showProfileSelector (): Promise<PartialProfile<Profile>|null> {
|
showProfileSelector (): Promise<PartialProfile<Profile>|null> {
|
||||||
return new Promise<PartialProfile<Profile>|null>(async (resolve, reject) => {
|
return new Promise<PartialProfile<Profile>|null>(async (resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
const recentProfiles: PartialProfile<Profile>[] = this.config.store.recentProfiles
|
let recentProfiles: PartialProfile<Profile>[] = this.config.store.recentProfiles
|
||||||
|
recentProfiles = recentProfiles.slice(0, this.config.store.terminal.showRecentProfiles)
|
||||||
|
|
||||||
let options: SelectorOption<void>[] = recentProfiles.map(p => ({
|
let options: SelectorOption<void>[] = recentProfiles.map(p => ({
|
||||||
...this.selectorOptionForProfile(p),
|
...this.selectorOptionForProfile(p),
|
||||||
|
@@ -17,6 +17,19 @@ h3.mb-3 Profiles
|
|||||||
[ngValue]='profile.id'
|
[ngValue]='profile.id'
|
||||||
) {{profile.name}}
|
) {{profile.name}}
|
||||||
|
|
||||||
|
.form-line(*ngIf='config.store.profiles.length > 0')
|
||||||
|
.header
|
||||||
|
.title Show recent profiles in selector
|
||||||
|
.description Set to 0 to disable recent profiles
|
||||||
|
|
||||||
|
input.form-control(
|
||||||
|
type='number',
|
||||||
|
min='0',
|
||||||
|
step='1',
|
||||||
|
[(ngModel)]='config.store.terminal.showRecentProfiles',
|
||||||
|
(ngModelChange)='config.save()'
|
||||||
|
)
|
||||||
|
|
||||||
.form-line(*ngIf='config.store.profiles.length > 0')
|
.form-line(*ngIf='config.store.profiles.length > 0')
|
||||||
.header
|
.header
|
||||||
.title Show built-in profiles in selector
|
.title Show built-in profiles in selector
|
||||||
@@ -27,6 +40,7 @@ h3.mb-3 Profiles
|
|||||||
(ngModelChange)='config.save()'
|
(ngModelChange)='config.save()'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
.d-flex.mb-3.mt-4
|
.d-flex.mb-3.mt-4
|
||||||
.input-group
|
.input-group
|
||||||
.input-group-prepend
|
.input-group-prepend
|
||||||
|
Reference in New Issue
Block a user