Skip to content

Commit 3c8302a

Browse files
author
Benjamin Pasero
committed
another fix for microsoft#62719
1 parent 23c7e02 commit 3c8302a

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/bootstrap-window.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,12 @@ function registerDeveloperKeybindings() {
169169

170170
// Devtools & reload support
171171
const TOGGLE_DEV_TOOLS_KB = (process.platform === 'darwin' ? 'meta-alt-73' : 'ctrl-shift-73'); // mac: Cmd-Alt-I, rest: Ctrl-Shift-I
172+
const TOGGLE_DEV_TOOLS_KB_ALT = '123'; // F12
172173
const RELOAD_KB = (process.platform === 'darwin' ? 'meta-82' : 'ctrl-82'); // mac: Cmd-R, rest: Ctrl-R
173174

174175
let listener = function (e) {
175176
const key = extractKey(e);
176-
if (key === TOGGLE_DEV_TOOLS_KB) {
177+
if (key === TOGGLE_DEV_TOOLS_KB || key === TOGGLE_DEV_TOOLS_KB_ALT) {
177178
ipc.send('vscode:toggleDevTools');
178179
} else if (key === RELOAD_KB) {
179180
ipc.send('vscode:reloadWindow');

src/vs/platform/menubar/electron-main/menubar.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,11 @@ export class Menubar {
719719
}
720720

721721
if (activeWindow) {
722-
if (!activeWindow.isReady && isMacintosh && id === 'workbench.action.toggleDevTools') {
723-
return; // prevent this action from running twice on macOS (https://github.com/Microsoft/vscode/issues/62719)
722+
if (!activeWindow.isReady && isMacintosh && id === 'workbench.action.toggleDevTools' && !this.environmentService.isBuilt) {
723+
// prevent this action from running twice on macOS (https://github.com/Microsoft/vscode/issues/62719)
724+
// we already register a keybinding in bootstrap-window.js for opening developer tools in case something
725+
// goes wrong and that keybinding is only removed when the application has loaded (= window ready).
726+
return;
724727
}
725728

726729
this.windowsMainService.sendToFocused('vscode:runAction', { id, from: 'menu' } as IRunActionInWindowRequest);

0 commit comments

Comments
 (0)