Skip to content

Commit 46b43d1

Browse files
authored
Fix remote.autoForwardPortsSource sometimes not respected from machine settings (microsoft#184860)
Fix microsoft#184859
1 parent 46041c9 commit 46b43d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/vs/workbench/contrib/remote/browser/remoteExplorer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { IExternalUriOpenerService } from 'vs/workbench/contrib/externalUriOpene
3131
import { IHostService } from 'vs/workbench/services/host/browser/host';
3232
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';
3333
import { ILogService } from 'vs/platform/log/common/log';
34+
import { IWorkbenchConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
3435

3536
export const VIEWLET_ID = 'workbench.view.remote';
3637

@@ -181,7 +182,7 @@ export class AutomaticPortForwarding extends Disposable implements IWorkbenchCon
181182
@IRemoteExplorerService remoteExplorerService: IRemoteExplorerService,
182183
@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService,
183184
@IContextKeyService contextKeyService: IContextKeyService,
184-
@IConfigurationService configurationService: IConfigurationService,
185+
@IWorkbenchConfigurationService configurationService: IWorkbenchConfigurationService,
185186
@IDebugService debugService: IDebugService,
186187
@IRemoteAgentService remoteAgentService: IRemoteAgentService,
187188
@ITunnelService tunnelService: ITunnelService,
@@ -193,7 +194,7 @@ export class AutomaticPortForwarding extends Disposable implements IWorkbenchCon
193194
return;
194195
}
195196

196-
remoteAgentService.getEnvironment().then(environment => {
197+
configurationService.whenRemoteConfigurationLoaded().then(() => remoteAgentService.getEnvironment()).then(environment => {
197198
if (environment?.os !== OperatingSystem.Linux) {
198199
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
199200
.registerDefaultConfigurations([{ overrides: { 'remote.autoForwardPortsSource': PORT_AUTO_SOURCE_SETTING_OUTPUT } }]);

0 commit comments

Comments
 (0)