提交 15a0e88d 编写于 作者: D Daniel Imms

Fix NPE in debug

This was caused by the change to make the shell default to null, debug now needs
to evaluate the default shell itself if the setting is null.

Fixes #73867
Caused by microsoft/vscode-remote-release#38
上级 e4fba6ab
......@@ -25,6 +25,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
import { TaskIdentifier } from 'vs/workbench/contrib/tasks/common/tasks';
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
import { IOutputService } from 'vs/workbench/contrib/output/common/output';
import { ITerminalConfiguration } from 'vs/workbench/contrib/terminal/common/terminal';
export const VIEWLET_ID = 'workbench.view.debug';
export const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(VIEWLET_ID);
......@@ -573,13 +574,7 @@ export interface ITerminalSettings {
osxExec: string,
linuxExec: string
};
integrated: {
shell: {
osx: string,
windows: string,
linux: string
}
};
integrated: ITerminalConfiguration;
}
export interface IConfigurationManager {
......
......@@ -10,6 +10,7 @@ import * as pfs from 'vs/base/node/pfs';
import { assign } from 'vs/base/common/objects';
import { ITerminalLauncher, ITerminalSettings } from 'vs/workbench/contrib/debug/common/debug';
import { getPathFromAmdModule } from 'vs/base/common/amd';
import { getDefaultShell } from 'vs/workbench/contrib/terminal/node/terminal';
const TERMINAL_TITLE = nls.localize('console.title', "VS Code Console");
......@@ -314,13 +315,13 @@ export function prepareCommand(args: DebugProtocol.RunInTerminalRequestArguments
let shell: string;
const shell_config = config.integrated.shell;
if (env.isWindows) {
shell = shell_config.windows;
shell = shell_config.windows || getDefaultShell(env.Platform.Windows);
shellType = ShellType.cmd;
} else if (env.isLinux) {
shell = shell_config.linux;
shell = shell_config.linux || getDefaultShell(env.Platform.Linux);
shellType = ShellType.bash;
} else if (env.isMacintosh) {
shell = shell_config.osx;
shell = shell_config.osx || getDefaultShell(env.Platform.Mac);
shellType = ShellType.bash;
} else {
throw new Error('Unknown platform');
......
......@@ -64,9 +64,9 @@ export type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '50
export interface ITerminalConfiguration {
shell: {
linux: string;
osx: string;
windows: string;
linux: string | null;
osx: string | null;
windows: string | null;
};
shellArgs: {
linux: string[];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册