Skip to content

Commit 42f0f08

Browse files
authored
Unable to Open VSCode From Command Line in Windows & WSL (fix microsoft#249882) (microsoft#249898)
1 parent 7088a16 commit 42f0f08

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/vs/platform/theme/electron-main/themeMainService.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { ThemeTypeSelector } from '../common/theme.js';
1616
import { ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from '../../workspace/common/workspace.js';
1717
import { coalesce } from '../../../base/common/arrays.js';
1818
import { getAllWindowsExcludingOffscreen } from '../../windows/electron-main/windows.js';
19+
import { ILogService } from '../../log/common/log.js';
1920

2021
// These default colors match our default themes
2122
// editor background color ("Dark Modern", etc...)
@@ -83,7 +84,8 @@ export class ThemeMainService extends Disposable implements IThemeMainService {
8384

8485
constructor(
8586
@IStateService private stateService: IStateService,
86-
@IConfigurationService private configurationService: IConfigurationService
87+
@IConfigurationService private configurationService: IConfigurationService,
88+
@ILogService private logService: ILogService
8789
) {
8890
super();
8991

@@ -318,6 +320,16 @@ export class ThemeMainService extends Disposable implements IThemeMainService {
318320
}
319321

320322
getWindowSplash(workspace: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | undefined): IPartsSplash | undefined {
323+
try {
324+
return this.doGetWindowSplash(workspace);
325+
} catch (error) {
326+
this.logService.error('[theme main service] Failed to get window splash', error);
327+
328+
return undefined;
329+
}
330+
}
331+
332+
private doGetWindowSplash(workspace: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier | undefined): IPartsSplash | undefined {
321333
const partSplash = this.stateService.getItem<IPartsSplash>(THEME_WINDOW_SPLASH_KEY);
322334
if (!partSplash?.layoutInfo) {
323335
return partSplash; // return early: overrides currently only apply to layout info

0 commit comments

Comments
 (0)