diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts index 13075b3c197b3cbd8c0754ce26203aef3a957c40..ff633cbd4871fd05285d09cbca935fa436310e22 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts @@ -158,15 +158,18 @@ export class TerminalConfigHelper { executable: '', args: [] }; - if (this._platform === Platform.Windows) { - shell.executable = config.terminal.integrated.shell.windows; - shell.args = config.terminal.integrated.shellArgs.windows; - } else if (this._platform === Platform.Mac) { - shell.executable = config.terminal.integrated.shell.osx; - shell.args = config.terminal.integrated.shellArgs.osx; - } else if (this._platform === Platform.Linux) { - shell.executable = config.terminal.integrated.shell.linux; - shell.args = config.terminal.integrated.shellArgs.linux; + const integrated = config && config.terminal && config.terminal.integrated; + if (integrated && integrated.shell && integrated.shellArgs) { + if (this._platform === Platform.Windows) { + shell.executable = integrated.shell.windows; + shell.args = integrated.shellArgs.windows; + } else if (this._platform === Platform.Mac) { + shell.executable = integrated.shell.osx; + shell.args = integrated.shellArgs.osx; + } else if (this._platform === Platform.Linux) { + shell.executable = integrated.shell.linux; + shell.args = integrated.shellArgs.linux; + } } return shell; } diff --git a/src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts b/src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts index 79e26ff261686391e56307746b431597ebf572ce..c1f629054900abbc18a0c7c796a5f7b9d6b88717 100644 --- a/src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts +++ b/src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts @@ -210,6 +210,9 @@ suite('Workbench - TerminalConfigHelper', () => { integrated: { shell: { windows: 'foo' + }, + shellArgs: { + windows: [] } } }