diff --git a/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts b/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts index 78264965a27c0178809527623b00f9669eba67af..8d9b3dda9f418355936c7aaea5e4a4ea0bfffdcb 100644 --- a/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts +++ b/src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts @@ -397,12 +397,45 @@ class RemoteTelemetryEnablementUpdater extends Disposable implements IWorkbenchC } } +class RemoteEmptyWorkbenchPresentation extends Disposable implements IWorkbenchContribution { + constructor( + @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, + @IRemoteAuthorityResolverService remoteAuthorityResolverService: IRemoteAuthorityResolverService, + @IConfigurationService configurationService: IConfigurationService, + @ICommandService commandService: ICommandService, + ) { + super(); + + function shouldShowExplorer(): boolean { + const startupEditor = configurationService.getValue('workbench.startupEditor'); + return startupEditor !== 'welcomePage' && startupEditor !== 'welcomePageInEmptyWorkbench'; + } + + function shouldShowTerminal(): boolean { + return shouldShowExplorer(); + } + + const { remoteAuthority, folderUri, workspace } = environmentService.configuration; + if (remoteAuthority && !folderUri && !workspace) { + remoteAuthorityResolverService.resolveAuthority(remoteAuthority).then(() => { + if (shouldShowExplorer()) { + commandService.executeCommand('workbench.view.explorer'); + } + if (shouldShowTerminal()) { + commandService.executeCommand('workbench.action.terminal.toggleTerminal'); + } + }); + } + } +} + const workbenchContributionsRegistry = Registry.as(WorkbenchContributionsExtensions.Workbench); workbenchContributionsRegistry.registerWorkbenchContribution(RemoteChannelsContribution, LifecyclePhase.Starting); workbenchContributionsRegistry.registerWorkbenchContribution(RemoteAgentDiagnosticListener, LifecyclePhase.Eventually); workbenchContributionsRegistry.registerWorkbenchContribution(RemoteAgentConnectionStatusListener, LifecyclePhase.Eventually); workbenchContributionsRegistry.registerWorkbenchContribution(RemoteWindowActiveIndicator, LifecyclePhase.Starting); workbenchContributionsRegistry.registerWorkbenchContribution(RemoteTelemetryEnablementUpdater, LifecyclePhase.Ready); +workbenchContributionsRegistry.registerWorkbenchContribution(RemoteEmptyWorkbenchPresentation, LifecyclePhase.Starting); Registry.as(ConfigurationExtensions.Configuration) .registerConfiguration({