Skip to content

Commit 11b28d3

Browse files
author
Jackson Kearl
authored
Disallow reloading in issue reporter. Fixes microsoft#77171 (microsoft#82131)
1 parent 6e8ff27 commit 11b28d3

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/bootstrap-window.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exports.assign = function assign(destination, source) {
2121
*
2222
* @param {string[]} modulePaths
2323
* @param {(result, configuration: object) => any} resultCallback
24-
* @param {{ forceEnableDeveloperKeybindings?: boolean, removeDeveloperKeybindingsAfterLoad?: boolean, canModifyDOM?: (config: object) => void, beforeLoaderConfig?: (config: object, loaderConfig: object) => void, beforeRequire?: () => void }=} options
24+
* @param {{ forceEnableDeveloperKeybindings?: boolean, disallowReloadKeybinding?: boolean, removeDeveloperKeybindingsAfterLoad?: boolean, canModifyDOM?: (config: object) => void, beforeLoaderConfig?: (config: object, loaderConfig: object) => void, beforeRequire?: () => void }=} options
2525
*/
2626
exports.load = function (modulePaths, resultCallback, options) {
2727

@@ -58,7 +58,7 @@ exports.load = function (modulePaths, resultCallback, options) {
5858
const enableDeveloperTools = (process.env['VSCODE_DEV'] || !!configuration.extensionDevelopmentPath) && !configuration.extensionTestsPath;
5959
let developerToolsUnbind;
6060
if (enableDeveloperTools || (options && options.forceEnableDeveloperKeybindings)) {
61-
developerToolsUnbind = registerDeveloperKeybindings();
61+
developerToolsUnbind = registerDeveloperKeybindings(options && options.disallowReloadKeybinding);
6262
}
6363

6464
// Correctly inherit the parent's environment
@@ -159,9 +159,10 @@ function parseURLQueryArgs() {
159159
}
160160

161161
/**
162+
* @param {boolean} disallowReloadKeybinding
162163
* @returns {() => void}
163164
*/
164-
function registerDeveloperKeybindings() {
165+
function registerDeveloperKeybindings(disallowReloadKeybinding) {
165166

166167
// @ts-ignore
167168
const ipc = require('electron').ipcRenderer;
@@ -185,7 +186,7 @@ function registerDeveloperKeybindings() {
185186
const key = extractKey(e);
186187
if (key === TOGGLE_DEV_TOOLS_KB || key === TOGGLE_DEV_TOOLS_KB_ALT) {
187188
ipc.send('vscode:toggleDevTools');
188-
} else if (key === RELOAD_KB) {
189+
} else if (key === RELOAD_KB && !disallowReloadKeybinding) {
189190
ipc.send('vscode:reloadWindow');
190191
}
191192
};

src/vs/code/electron-browser/issue/issueReporter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ const bootstrapWindow = require('../../../../bootstrap-window');
1010

1111
bootstrapWindow.load(['vs/code/electron-browser/issue/issueReporterMain'], function (issueReporter, configuration) {
1212
issueReporter.startup(configuration);
13-
}, { forceEnableDeveloperKeybindings: true });
13+
}, { forceEnableDeveloperKeybindings: true, disallowReloadKeybinding: true });

0 commit comments

Comments
 (0)