-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terminals launched with invalid paths hang during creation and never emit onExit #31301
Comments
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:
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 |
I upgraded to node-pty@0.7.0 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: https://github.com/Tyriar/node-pty/blob/a1d161cba7396849116b94d8fa6bb0041a9a7ea6/src/win/pty.cc#L87, meaning this function never returns https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/terminal/node/terminalProcess.ts#L47 Not sure why a Node.js or native exception isn't happening. |
This has the same root cause as #31770 |
Moving to September as this is a more involved change than I anticipated. More testing in Insiders would be ideal. |
@Tyriar 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 launch.json
tasks.json
Everything works fine if the error code is changed to |
Was this never solved? |
@Tyriar 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. |
@Tyriar, does this sound like something that will be fixed by conpty? |
@alexr00 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. |
@Tyriar There's already a
|
Steps to Reproduce:
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.
Reproduces without extensions: Yes/No
The text was updated successfully, but these errors were encountered: