mirror of
https://github.com/Eugeny/tabby
synced 2024-11-14 17:07:15 +00:00
fixed #4230 - option to limit or disable "recent profiles"
This commit is contained in:
parent
1926eca929
commit
90149def0a
4 changed files with 23 additions and 5 deletions
|
@ -36,10 +36,12 @@ export class ButtonProvider extends ToolbarButtonProvider {
|
|||
await this.profilesService.openNewTabForProfile(profile)
|
||||
|
||||
let recentProfiles = this.config.store.recentProfiles
|
||||
recentProfiles = recentProfiles.filter(x => x.group !== profile.group || x.name !== profile.name)
|
||||
recentProfiles.unshift(profile)
|
||||
if (recentProfiles.length > 5) {
|
||||
recentProfiles.pop()
|
||||
if (this.config.store.terminal.showRecentProfiles > 0) {
|
||||
recentProfiles = recentProfiles.filter(x => x.group !== profile.group || x.name !== profile.name)
|
||||
recentProfiles.unshift(profile)
|
||||
recentProfiles = recentProfiles.slice(0, this.config.store.terminal.showRecentProfiles)
|
||||
} else {
|
||||
recentProfiles = []
|
||||
}
|
||||
this.config.store.recentProfiles = recentProfiles
|
||||
this.config.save()
|
||||
|
|
|
@ -16,6 +16,7 @@ appearance:
|
|||
vibrancyType: 'blur'
|
||||
terminal:
|
||||
showBuiltinProfiles: true
|
||||
showRecentProfiles: 3
|
||||
hotkeys:
|
||||
profile:
|
||||
__nonStructural: true
|
||||
|
|
|
@ -93,7 +93,8 @@ export class ProfilesService {
|
|||
showProfileSelector (): Promise<PartialProfile<Profile>|null> {
|
||||
return new Promise<PartialProfile<Profile>|null>(async (resolve, reject) => {
|
||||
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 => ({
|
||||
...this.selectorOptionForProfile(p),
|
||||
|
|
|
@ -17,6 +17,19 @@ h3.mb-3 Profiles
|
|||
[ngValue]='profile.id'
|
||||
) {{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')
|
||||
.header
|
||||
.title Show built-in profiles in selector
|
||||
|
@ -27,6 +40,7 @@ h3.mb-3 Profiles
|
|||
(ngModelChange)='config.save()'
|
||||
)
|
||||
|
||||
|
||||
.d-flex.mb-3.mt-4
|
||||
.input-group
|
||||
.input-group-prepend
|
||||
|
|
Loading…
Reference in a new issue