Change:
VSCode Version: Code 1.14.2 (, 2017-07-19T23:34:09.706Z) OS Version: Windows_NT ia32 10.0. Extensions: ExtensionVersion ------ cpptools0.12.1 csharp1.11.0 Steps to Reproduce: an empty folder with VSCode a new MSBuild task building (execute task) Expected: Fails gracefully somehow Actual: Just spins forever and never dies until I manually kill the task. Note: this also happens when I mistype a path or something in the command to a directory that say for example doesn't exist. If the command is wrong in some way, the task will just spin forever. <!-- Launch with to check. --Reproduces without extensions: Yes/No
The terminal doesn't send an onExit or any other event in this case so that the task system could determine that the process has finished / died. Steps to reproduce: Windows, no msbuild installed fresh workspace configure task runner select MSBuild from the list of templates F1 Run Task Select Build Observe: the spinner never stops. Could can't even terminate the task. The reason is that the shell actually fails to execute msbuild however the terminal never send an onExit event. Look at the process explorer there is a lingering vscode process of --type=terminal <img width="521" alt="capture" src="https://user-"
I upgraded to node-pty which may improve the problem, if not I'd guess this is related towinpty is not terminating the processes correctly.
I retested this and it is still happening under Insider today.
terminalProcess stalls on this native call: , meaning this function never returns Not sure why a or native exception isn't happening.
This has the same root cause as
Moving to September as this is a more involved change than I anticipated. More testing in Insiders would be ideal.
any news on this. Do I need to adopt something here ?
No progress, I moved this to September before I knew that I would be out for 2 weeks in September.
It does look like it affects Windows only.
Hmm, I believe that I just came across this while trying to run some tests, and exited with an error code. I was able to reproduce it using this: Everything works fine if the error code is changed to .
Was this never solved?
when I last tested this I had the impression that this is still a bug and the terminal hangs (doesn't signal on exit).
Yes, this is still an issue.
Is this in line to be fixed btw?
This still happens btw when I'm doing my PowerShell development.....I have to keep restarting all of VSCode because my debugging sessions won't end properly.
does this sound like something that will be fixed by conpty?
it probably needs a check in node-pty that the file exists before attempting to fire it. It's possible that conpty would fix this but that would only fix it for newer Windows versions when the fix should work when we fallback to winpty.
There's already a check in node-pty before attempting to execute the file. I can't actually reproduce this with a garbage command in my task (ex. ) I do think I'm seeing this when I pass garbage in for the that results in a failure though: 'c:usersalrosdesktop' is not recognized as an internal or external command, operable program or batch file.`

Discussion:
rows }; <del> this._ptyProcess = pty.spawn(shellLaunchConfig.executable, shellLaunchConfig.args, options); </del> <ins> try { this._ptyProcess = pty.spawn(shellLaunchConfig.executable, shellLaunchConfig.args, options); } catch (error) { // The only time this is expected to happen is when the file specified to launch with does not exist. this._exitCode = 2; this._queueProcessExit(); return; } </ins> this._ptyProcess.on('data', (data) => { this._onProcessData.fire(data); if (this._closeTimeout) {