Skip to content

Commit

Permalink
Fix NPE in debug
Browse files Browse the repository at this point in the history
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 microsoft#73867
Caused by microsoft/vscode-remote-release#38
  • Loading branch information
Tyriar committed May 20, 2019
1 parent e4fba6a commit 15a0e88
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
9 changes: 2 additions & 7 deletions src/vs/workbench/contrib/debug/common/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -573,13 +574,7 @@ export interface ITerminalSettings {
osxExec: string,
linuxExec: string
};
integrated: {
shell: {
osx: string,
windows: string,
linux: string
}
};
integrated: ITerminalConfiguration;
}

export interface IConfigurationManager {
Expand Down
7 changes: 4 additions & 3 deletions src/vs/workbench/contrib/debug/node/terminals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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');
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/terminal/common/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down

0 comments on commit 15a0e88

Please sign in to comment.