diff --git a/src/vs/code/electron-main/menus.ts b/src/vs/code/electron-main/menus.ts index 5a75ca643f6..412efbcad58 100644 --- a/src/vs/code/electron-main/menus.ts +++ b/src/vs/code/electron-main/menus.ts @@ -453,7 +453,7 @@ export class VSCodeMenu { private createOpenRecentMenuItem(path: string): Electron.MenuItem { return new MenuItem({ - label: path, click: () => { + label: unMnemonicLabel(path), click: () => { let success = !!this.windowsService.open({ cli: this.envService.cliArgs, pathsToOpen: [path] }); if (!success) { this.removeFromOpenedPathsList(path); @@ -861,8 +861,16 @@ function __separator__(): Electron.MenuItem { function mnemonicLabel(label: string): string { if (platform.isMacintosh) { - return label.replace(/\(&&\w\)|&&/g, ''); // no mnemonic support on mac/linux + return label.replace(/\(&&\w\)|&&/g, ''); // no mnemonic support on mac } return label.replace(/&&/g, '&'); } + +function unMnemonicLabel(label: string): string { + if (platform.isMacintosh) { + return label; // no mnemonic support on mac + } + + return label.replace(/&/g, '&&'); +} \ No newline at end of file