diff --git a/tabby-core/src/commands.ts b/tabby-core/src/commands.ts index 2af7b6b6..88a81b26 100644 --- a/tabby-core/src/commands.ts +++ b/tabby-core/src/commands.ts @@ -18,7 +18,7 @@ export class CoreCommandProvider extends CommandProvider { } async activate () { - const profile = await this.profilesService.showProfileSelector() + const profile = await this.profilesService.showProfileSelector().catch(() => null) if (profile) { this.profilesService.launchProfile(profile) } diff --git a/tabby-core/src/index.ts b/tabby-core/src/index.ts index e376edec..25b5e1ad 100644 --- a/tabby-core/src/index.ts +++ b/tabby-core/src/index.ts @@ -191,7 +191,7 @@ export default class AppModule { // eslint-disable-line @typescript-eslint/no-ex this.showSelector(provider) } if (hotkey === 'command-selector') { - commands.showSelector() + commands.showSelector().catch(() => {return}) } if (hotkey === 'profile-selector') { diff --git a/tabby-core/src/services/commands.service.ts b/tabby-core/src/services/commands.service.ts index dddb2135..739b0b49 100644 --- a/tabby-core/src/services/commands.service.ts +++ b/tabby-core/src/services/commands.service.ts @@ -101,7 +101,7 @@ export class CommandService { context.tab = tab.getFocusedTab() ?? undefined } const commands = await this.getCommands(context) - await this.selector.show( + return this.selector.show( this.translate.instant('Commands'), commands.map(c => ({ name: c.label, @@ -109,6 +109,6 @@ export class CommandService { description: c.sublabel, icon: c.icon, })), - ).catch(() => {return}) + ).then(() => {return}) } } diff --git a/tabby-core/src/services/profiles.service.ts b/tabby-core/src/services/profiles.service.ts index ad6c991e..51ab8acd 100644 --- a/tabby-core/src/services/profiles.service.ts +++ b/tabby-core/src/services/profiles.service.ts @@ -323,7 +323,7 @@ export class ProfilesService { } }) - await this.selector.show(this.translate.instant('Select profile or enter an address'), options).catch(() => resolve(null)) + await this.selector.show(this.translate.instant('Select profile or enter an address'), options).catch(() => reject()) } catch (err) { reject(err) } diff --git a/tabby-core/src/tabContextMenu.ts b/tabby-core/src/tabContextMenu.ts index 56c3c904..e0ed6d1f 100644 --- a/tabby-core/src/tabContextMenu.ts +++ b/tabby-core/src/tabContextMenu.ts @@ -262,7 +262,7 @@ export class ProfilesContextMenu extends TabContextMenuItemProvider { } async switchTabProfile (tab: BaseTabComponent) { - const profile = await this.profilesService.showProfileSelector() + const profile = await this.profilesService.showProfileSelector().catch(() => null) if (!profile) { return }