Change:
Invalid paths will cause the terminal to start at ' dir.
Is a variable a valid option to ? If so what variables? eg the directory of the current active document. This would replace the need for addin.
created
Would you suggest me to work on this thing and
Sorry for the delay, anything with the help wanted label is up for grabs
I'm sorry if it's not the correct issue to post this. I came here from following a bunch of now closed issues. So in case it could help you figure out what's wrong with this: I am having the very same error as described by . It started just after I upgraded budgie 17.10 (based on ubuntu) to 18.04 It happens only if all 3 of these conditions are met: have no terminal opened in the current instance of vscode. have several folders opened in the workspace have no specified (more on this below). If I use the command instead of the command , it prompts me to chose one of the opened folders in the workspace, and the terminal always starts successfully in this case. When trying to toggle the terminal (without any currently opened): The terminal fails to start with: set to either or . But the terminal starts successfully with a static value such as .
I have the same issue as , is there any solution to do this ? Split Terminal used to work, but now just trows 'chdir(2) failed' and 'The terminal process command '/bin/bash -l' failed to launch (exit code: 1)'
I noticed this problem for the first time today. I get the same error when I try to split the terminal. The issue occurs whenever I use the "Split Terminal" command. Using the "New Terminal" command does not throw this error.
After investigating a little further, the problem in my case is being caused by a unicode character in my file path. One of the folders in my file path is , and the apostrophe (right single quote) is the root of the problem. Removing that character from the folder name fixes it. I'm not sure why this only shows up with the "Split Terminal" command, though.
the cwd in split terminal is driven by this: ! It sounds like inherited (likely) breaks when it contains a ? Can you create a new issue for this?

Discussion:
import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { PANEL_BACKGROUND } from 'vs/workbench/common/theme'; import { TerminalWidgetManager } from 'vs/workbench/contrib/terminal/browser/terminalWidgetManager'; <del> import { IShellLaunchConfig, ITerminalDimensions, ITerminalInstance, ITerminalProcessManager, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, NEVER_MEASURE_RENDER_TIME_STORAGE_KEY, ProcessState, TERMINAL_PANEL_ID, IWindowsShellHelper, SHELL_PATH_INVALID_EXIT_CODE, SHELL_PATH_DIRECTORY_EXIT_CODE } from 'vs/workbench/contrib/terminal/common/terminal'; </del> <ins> import { IShellLaunchConfig, ITerminalDimensions, ITerminalInstance, ITerminalProcessManager, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, NEVER_MEASURE_RENDER_TIME_STORAGE_KEY, ProcessState, TERMINAL_PANEL_ID, IWindowsShellHelper, SHELL_PATH_INVALID_EXIT_CODE, SHELL_PATH_DIRECTORY_EXIT_CODE, SHELL_CWD_INVALID_EXIT_CODE } from 'vs/workbench/contrib/terminal/common/terminal'; </ins> import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_CURSOR_BACKGROUND_COLOR, TERMINAL_CURSOR_FOREGROUND_COLOR, TERMINAL_FOREGROUND_COLOR, TERMINAL_SELECTION_BACKGROUND_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry'; import { TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminalCommands'; import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/terminalConfigHelper';

exitCodeMessage = nls.localize('terminal.integrated.exitedWithInvalidPath', 'The terminal shell path "{0}" does not exist', this._shellLaunchConfig.executable); } else if (exitCode === SHELL_PATH_DIRECTORY_EXIT_CODE) { exitCodeMessage = nls.localize('terminal.integrated.exitedWithInvalidPathDirectory', 'The terminal shell path "{0}" is a directory', this._shellLaunchConfig.executable); <ins> } else if (exitCode === SHELL_CWD_INVALID_EXIT_CODE && this._shellLaunchConfig.cwd) { exitCodeMessage = nls.localize('terminal.integrated.exitedWithInvalidCWD', 'The terminal shell CWD "{0}" does not exist', this._shellLaunchConfig.cwd.toString()); </ins> } else if (this._processManager && this._processManager.processState === ProcessState.KILLED_DURING_LAUNCH) { let args = ''; if (typeof this._shellLaunchConfig.args === 'string') {

export const DEFAULT_LINE_HEIGHT = 1; export const SHELL_PATH_INVALID_EXIT_CODE = -1; export const SHELL_PATH_DIRECTORY_EXIT_CODE = -2; <ins> export const SHELL_CWD_INVALID_EXIT_CODE = -3; </ins> export type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';

import { Event, Emitter } from 'vs/base/common/event'; import { getWindowsBuildNumber } from 'vs/workbench/contrib/terminal/node/terminal'; import { IDisposable } from 'vs/base/common/lifecycle'; <del> import { IShellLaunchConfig, ITerminalChildProcess, SHELL_PATH_INVALID_EXIT_CODE, SHELL_PATH_DIRECTORY_EXIT_CODE } from 'vs/workbench/contrib/terminal/common/terminal'; </del> <ins> import { IShellLaunchConfig, ITerminalChildProcess, SHELL_PATH_INVALID_EXIT_CODE, SHELL_PATH_DIRECTORY_EXIT_CODE, SHELL_CWD_INVALID_EXIT_CODE } from 'vs/workbench/contrib/terminal/common/terminal'; </ins> import { exec } from 'child_process'; import { ILogService } from 'vs/platform/log/common/log'; import { stat } from 'vs/base/node/pfs';

conptyInheritCursor: true }; <del> stat(shellLaunchConfig.executable!).then(stat => { </del> <ins> const cwdVerification = stat(cwd).then(async stat => { if (!stat.isDirectory()) { return Promise.reject(SHELL_CWD_INVALID_EXIT_CODE); } }, async err => { if (err && err.code === 'ENOENT') { // So we can include in the error message the specified CWD shellLaunchConfig.cwd = cwd; return Promise.reject(SHELL_CWD_INVALID_EXIT_CODE); } }); const exectuableVerification = stat(shellLaunchConfig.executable!).then(async stat => { </ins> if (!stat.isFile() && !stat.isSymbolicLink()) { <del> return this._launchFailed(stat.isDirectory() ? SHELL_PATH_DIRECTORY_EXIT_CODE : SHELL_PATH_INVALID_EXIT_CODE); </del> <ins> return Promise.reject(stat.isDirectory() ? SHELL_PATH_DIRECTORY_EXIT_CODE : SHELL_PATH_INVALID_EXIT_CODE); </ins> } <del> this.setupPtyProcess(shellLaunchConfig, options); </del> }, async (err) => { if (err && err.code === 'ENOENT') { let cwd = shellLaunchConfig.cwd instanceof URI ? shellLaunchConfig.cwd.path : shellLaunchConfig.cwd!; const executable = await findExecutable(shellLaunchConfig.executable!, cwd); if (!executable) { <del> return this._launchFailed(SHELL_PATH_INVALID_EXIT_CODE); </del> <ins> return Promise.reject(SHELL_PATH_INVALID_EXIT_CODE); </ins> } } <ins> }); Promise.all([cwdVerification, exectuableVerification]).then(() => { </ins> this.setupPtyProcess(shellLaunchConfig, options); <ins> }).catch((exitCode: number) => { return this._launchFailed(exitCode); </ins> }); }