-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Setting startingDirectory to WSL path causes indefinite application hang #9541
Comments
Sorry -- all we do is pass that path off to CreateProcess. If the WSL interop implementation is hanging, it'll be bad... I wonder if Terminal can/should have a process startup watchdog? "[process failed to start in 10 seconds; you likely don't want to try to continue]" |
Separate but related: WSL2 takes about 5 seconds to start up cold on my system, and I notice the terminal UI hangs for the duration. |
Oh that's why my "Good Morning" script seems to hang. Not because it's asking the Terminal to do too much, but because the launch of WSL is slow. I wonder if we can start the process maybe on a background thread? Or if we're waiting for the connection to actually start before doing UI work, could we just, not? |
@zadjii-msft not without risking the WSL profiles (and if one is set as default, a pop-up dialog saying "lol you messed up somehow"). This is, in part, why I keep talking about caching generated profiles 😉 |
@DHowet I ended up nuking my WSL distros, and the issue went away. Watchdog of some sort would be nice, since the only way I could kill the terminal process was though Terminal's PC Settings "Terminate" button. |
Oh, I realize now @zadjii-msft that you're talking about spawning the connection in the background, not launching WSL to scan for things. We also evaluate the starting directory for validity (!) during settings load. |
Ohkay good, I thought there must have been a miscommunication.
Oh well that's probably what's doing it. Maybe we should just ditch that 🤔 |
I'm bumping this to 1.8 - we might want to preemptively fix this, esp. before pushing OSC9;9 to stable |
Oh no, this isn't what I thought it was. I thought we had some quick path validation if a path existed for the OSC9;9 case. But we actually don't...
EDIT: Ah no, the line in question is in _StartingDirectory = profile.EvaluatedStartingDirectory();
WHICH HAS LITERALLY ALWAYS EXISTED: LITERALLY SINCE d4d59fa So I'm punting this back out of 1.8. |
for the record, i'm not seeing this issue with it hanging, i used the path:
windows ver: 21364.1 |
This is promarily being done to unblock #9223. Prior to this, we'd validate that the user's `startingDirectory` existed here. If it was invalid, we'd gracefully fall back to `%USERPROFILE%`. However, that could cause hangs when combined with WSL. When the WSL filesystem is slow to respond, we'll end up waiting indefinitely for their filesystem driver to respond. This can result in the whole terminal becoming unresponsive. Similarly, with #9223 we want users to be able to specify WSL paths in a profile, but this bit of validation logic totally prevents that from working, because it'll just replace the path with `%USERPROFILE%`. If the path is eventually invalid, we'll display warning in the `ConptyConnection`, when the process fails to launch. Closes #9541 Closes #9114
This is primarily being done to unblock #9223. Prior to this, we'd validate that the user's `startingDirectory` existed here. If it was invalid, we'd gracefully fall back to `%USERPROFILE%`. However, that could cause hangs when combined with WSL. When the WSL filesystem is slow to respond, we'll end up waiting indefinitely for their filesystem driver to respond. This can result in the whole terminal becoming unresponsive. Similarly, with #9223 we want users to be able to specify WSL paths in a profile, but this bit of validation logic totally prevents that from working, because it'll just replace the path with `%USERPROFILE%`. If the path is eventually invalid, we'll display warning in the `ConptyConnection`, when the process fails to launch. Closes #9541 Closes #9114 ![image](https://user-images.githubusercontent.com/18356694/117318675-426d2d00-ae50-11eb-9cc0-0b23c397472c.png)
This is primarily being done to unblock #9223. Prior to this, we'd validate that the user's `startingDirectory` existed here. If it was invalid, we'd gracefully fall back to `%USERPROFILE%`. However, that could cause hangs when combined with WSL. When the WSL filesystem is slow to respond, we'll end up waiting indefinitely for their filesystem driver to respond. This can result in the whole terminal becoming unresponsive. Similarly, with #9223 we want users to be able to specify WSL paths in a profile, but this bit of validation logic totally prevents that from working, because it'll just replace the path with `%USERPROFILE%`. If the path is eventually invalid, we'll display warning in the `ConptyConnection`, when the process fails to launch. Closes #9541 Closes #9114 ![image](https://user-images.githubusercontent.com/18356694/117318675-426d2d00-ae50-11eb-9cc0-0b23c397472c.png) (cherry picked from commit bfc4838)
🎉This issue was addressed in #10045, which has now been successfully released as Handy links: |
🎉This issue was addressed in #10045, which has now been successfully released as Handy links: |
Environment
Steps to reproduce
Add the following
startingDirectory
to a profile like so:Expected behavior
Terminal launches profile in starting directory. This has worked for awhile, issue started occuring after some recent updates (either Windows or Terminal).
Actual behavior
Terminal hangs forever when starting profile from new tab dropdown, jumplist, etc.
Note: this screenshot was taken after the
startingDirectory
was added in mysettings.json
while application was running. Terminal crashes as soon as the updated profile was clicked. Terminal launched fine and profile worked before adding line.The text was updated successfully, but these errors were encountered: