fix(coding-agent): show Option key on macOS

closes #4289
This commit is contained in:
Mario Zechner
2026-05-08 15:28:17 +02:00
parent c889ff40e3
commit 91bacac739
5 changed files with 38 additions and 26 deletions

View File

@@ -108,7 +108,7 @@ import { ExtensionEditorComponent } from "./components/extension-editor.js";
import { ExtensionInputComponent } from "./components/extension-input.js";
import { ExtensionSelectorComponent } from "./components/extension-selector.js";
import { FooterComponent } from "./components/footer.js";
import { keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
import { formatKeyText, keyDisplayText, keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
import { LoginDialogComponent } from "./components/login-dialog.js";
import { ModelSelectorComponent } from "./components/model-selector.js";
import { type AuthSelectorProvider, OAuthSelectorComponent } from "./components/oauth-selector.js";
@@ -5137,33 +5137,18 @@ export class InteractiveMode {
this.ui.requestRender();
}
/**
* Capitalize keybinding for display (e.g., "ctrl+c" -> "Ctrl+C").
*/
private capitalizeKey(key: string): string {
return key
.split("/")
.map((k) =>
k
.split("+")
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
.join("+"),
)
.join("/");
}
/**
* Get capitalized display string for an app keybinding action.
*/
private getAppKeyDisplay(action: AppKeybinding): string {
return this.capitalizeKey(keyText(action));
return keyDisplayText(action);
}
/**
* Get capitalized display string for an editor keybinding action.
*/
private getEditorKeyDisplay(action: Keybinding): string {
return this.capitalizeKey(keyText(action));
return keyDisplayText(action);
}
private handleHotkeysCommand(): void {
@@ -5267,7 +5252,7 @@ export class InteractiveMode {
`;
for (const [key, shortcut] of shortcuts) {
const description = shortcut.description ?? shortcut.extensionPath;
const keyDisplay = key.replace(/\b\w/g, (c) => c.toUpperCase());
const keyDisplay = formatKeyText(key, { capitalize: true });
hotkeys += `| \`${keyDisplay}\` | ${description} |\n`;
}
}