show recent profiles in jump lists & dock menu - fixes #2587

This commit is contained in:
Eugene Pankov
2022-02-23 20:36:24 +01:00
parent 5caa4d14f5
commit 555c8c18ee
3 changed files with 48 additions and 16 deletions

View File

@@ -23,6 +23,10 @@ export class ProfileCLIHandler extends CLIHandler {
this.handleOpenProfile(event.argv.profileName)
return true
}
if (op === 'recent') {
this.handleOpenRecentProfile(event.argv.profileNumber)
return true
}
return false
}
@@ -35,6 +39,15 @@ export class ProfileCLIHandler extends CLIHandler {
this.profiles.openNewTabForProfile(profile)
this.hostWindow.bringToFront()
}
private async handleOpenRecentProfile (profileNumber: number) {
const profiles = this.profiles.getRecentProfiles()
if (profileNumber >= profiles.length) {
return
}
this.profiles.openNewTabForProfile(profiles[profileNumber])
this.hostWindow.bringToFront()
}
}
@Injectable()