|
6 | 6 | } from '@theia/core/lib/browser/common-frontend-contribution';
|
7 | 7 | import { CommandRegistry } from '@theia/core/lib/common/command';
|
8 | 8 | import type { OnWillStopAction } from '@theia/core/lib/browser/frontend-application';
|
| 9 | +import { KeybindingRegistry } from '@theia/core/lib/browser'; |
| 10 | +import { isOSX } from '@theia/core'; |
9 | 11 |
|
10 | 12 | @injectable()
|
11 | 13 | export class CommonFrontendContribution extends TheiaCommonFrontendContribution {
|
@@ -50,6 +52,36 @@ export class CommonFrontendContribution extends TheiaCommonFrontendContribution
|
50 | 52 | }
|
51 | 53 | }
|
52 | 54 |
|
| 55 | + override registerKeybindings(registry: KeybindingRegistry): void { |
| 56 | + super.registerKeybindings(registry); |
| 57 | + // Workaround for https://github.com/eclipse-theia/theia/issues/11875 |
| 58 | + if (isOSX) { |
| 59 | + registry.unregisterKeybinding('ctrlcmd+tab'); |
| 60 | + registry.unregisterKeybinding('ctrlcmd+alt+d'); |
| 61 | + registry.unregisterKeybinding('ctrlcmd+shift+tab'); |
| 62 | + registry.unregisterKeybinding('ctrlcmd+alt+a'); |
| 63 | + |
| 64 | + registry.registerKeybindings( |
| 65 | + { |
| 66 | + command: CommonCommands.NEXT_TAB.id, |
| 67 | + keybinding: 'ctrl+tab', |
| 68 | + }, |
| 69 | + { |
| 70 | + command: CommonCommands.NEXT_TAB.id, |
| 71 | + keybinding: 'ctrl+alt+d', |
| 72 | + }, |
| 73 | + { |
| 74 | + command: CommonCommands.PREVIOUS_TAB.id, |
| 75 | + keybinding: 'ctrl+shift+tab', |
| 76 | + }, |
| 77 | + { |
| 78 | + command: CommonCommands.PREVIOUS_TAB.id, |
| 79 | + keybinding: 'ctrl+alt+a', |
| 80 | + } |
| 81 | + ); |
| 82 | + } |
| 83 | + } |
| 84 | + |
53 | 85 | override onWillStop(): OnWillStopAction | undefined {
|
54 | 86 | // This is NOOP here. All window close and app quit requests are handled in the `Close` contribution.
|
55 | 87 | return undefined;
|
|
0 commit comments