File tree Expand file tree Collapse file tree
src/vs/code/electron-main Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,6 +118,8 @@ export class CodeWindow extends Disposable implements ICodeWindow {
118118
119119 private readonly touchBarGroups : TouchBarSegmentedControl [ ] ;
120120
121+ private currentHttpProxy ?: string ;
122+
121123 constructor (
122124 config : IWindowCreationOptions ,
123125 @ILogService private readonly logService : ILogService ,
@@ -594,6 +596,16 @@ export class CodeWindow extends Disposable implements ICodeWindow {
594596 this . currentMenuBarVisibility = newMenuBarVisibility ;
595597 this . setMenuBarVisibility ( newMenuBarVisibility ) ;
596598 }
599+ // Do not set to empty configuration at startup if setting is empty to not override configuration through CLI options:
600+ const newHttpProxy = ( this . configurationService . getValue < string > ( 'http.proxy' ) || '' ) . trim ( ) || undefined ;
601+ if ( newHttpProxy !== this . currentHttpProxy ) {
602+ this . currentHttpProxy = newHttpProxy ;
603+ this . _win . webContents . session . setProxy ( {
604+ proxyRules : newHttpProxy || '' ,
605+ proxyBypassRules : '' ,
606+ pacScript : '' ,
607+ } ) ;
608+ }
597609 }
598610
599611 addTabbedWindow ( window : ICodeWindow ) : void {
You can’t perform that action at this time.
0 commit comments