diff --git a/src/main/shell.ts b/src/main/shell.ts index 56160600..abff58cf 100644 --- a/src/main/shell.ts +++ b/src/main/shell.ts @@ -28,11 +28,16 @@ const transformCdCommand = (command: string) => { return `cd '${path.replace(/'/g, '\\\'')}'` } + const shell = getShell() // transform path for WSL shell. - if (getShell().indexOf('wsl.exe') > -1) { + if (shell.endsWith('wsl.exe')) { return `cd '${toWslPath(path).replace(/'/g, '\\\'')}'` } + if (shell.endsWith('powershell.exe')) { + return `cd '${path}'\n` + } + // change dir for Windows. return `cd /d "${path}"\r` }