Merge from vscode 2e5312cd61ff99c570299ecc122c52584265eda2

This commit is contained in:
ADS Merger
2020-04-23 02:50:35 +00:00
committed by Anthony Dresser
parent 3603f55d97
commit 7f1d8fc32f
659 changed files with 22709 additions and 12497 deletions

View File

@@ -118,6 +118,9 @@ export class CodeWindow extends Disposable implements ICodeWindow {
private readonly touchBarGroups: TouchBarSegmentedControl[];
private currentHttpProxy?: string;
private currentNoProxy?: string;
constructor(
config: IWindowCreationOptions,
@ILogService private readonly logService: ILogService,
@@ -406,7 +409,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
return callback({ cancel: true });
}
return callback({ cancel: false, responseHeaders });
return callback({ cancel: false });
});
// Remember that we loaded
@@ -594,6 +597,24 @@ export class CodeWindow extends Disposable implements ICodeWindow {
this.currentMenuBarVisibility = newMenuBarVisibility;
this.setMenuBarVisibility(newMenuBarVisibility);
}
// Do not set to empty configuration at startup if setting is empty to not override configuration through CLI options:
const env = process.env;
const newHttpProxy = (this.configurationService.getValue<string>('http.proxy') || '').trim()
|| (env.https_proxy || process.env.HTTPS_PROXY || process.env.http_proxy || process.env.HTTP_PROXY || '').trim() // Not standardized.
|| undefined;
const newNoProxy = (env.no_proxy || env.NO_PROXY || '').trim() || undefined; // Not standardized.
if ((newHttpProxy || '').indexOf('@') === -1 && (newHttpProxy !== this.currentHttpProxy || newNoProxy !== this.currentNoProxy)) {
this.currentHttpProxy = newHttpProxy;
this.currentNoProxy = newNoProxy;
const proxyRules = newHttpProxy || '';
const proxyBypassRules = newNoProxy ? `${newNoProxy},<local>` : '<local>';
this.logService.trace(`Setting proxy to '${proxyRules}', bypassing '${proxyBypassRules}'`);
this._win.webContents.session.setProxy({
proxyRules,
proxyBypassRules,
pacScript: '',
});
}
}
addTabbedWindow(window: ICodeWindow): void {