Works around WSL2(?) issue

Bash/wsl fails to return until stdin pipe is ended in recent Win vers
This commit is contained in:
Eric Amodio 2019-10-24 13:24:26 -04:00
parent e599448b07
commit 34d02c22fa

View file

@ -69,9 +69,10 @@ export class TerminalNativeService implements ITerminalNativeService {
throw new Error('wslpath does not exist on Windows build < 17063');
}
return new Promise<string>(c => {
execFile('bash.exe', ['-c', 'echo $(wslpath ' + escapeNonWindowsPath(path) + ')'], {}, (error, stdout, stderr) => {
const proc = execFile('bash.exe', ['-c', `wslpath ${escapeNonWindowsPath(path)}`], {}, (error, stdout, stderr) => {
c(escapeNonWindowsPath(stdout.trim()));
});
proc.stdin.end();
});
}