-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
startingDirectory being invalid shouldn't cause silent failures #10225
Comments
I don't understand all these bug reports @craigloewen-msft about windows terminal, cause it works perfectly for me! Good job! Glad you fixed the wsl clock thing! The News and Interests new "feature" in the tray is broken, but that's another story... where can I file a bug report about that? |
In #5214 (comment), it was mentioned that there was a plan to make Windows Terminal leave the session open if the process exits within five seconds. That would presumably cover invalid starting directories as well. However, I did not find an issue specifically for the five-second threshold feature. |
I think that's probably a good idea. It kinda conflicts with the idea of So I guess the philosophical question is "does Okay I've talked myself into it |
notes from Teams: "The connection couldn't even be established" (state transitions from "Connecting" to "Failed" without passing through "Connected") |
I have exactly the opposite behavior, and I don't like it. My closeOnExit value is set to graceful (not sure how that plays into this). I had set the starting directory for both Ubuntu and Powershell to the value
Setting the Startup directory to the parent process directory, or to But immediately exiting seems like a terrible way for the terminal to handle not finding a directory. It should at least default to the parent process directory, I think. |
This has never worked the way you're expecting. But, oh crap -- @zadjii-msft when we removed starting directory validation we also removed the magic fallback that substituted in |
You can also just remove the That value will cease being invalid once #9223 lands. |
@DHowett To clarify, when I said "since this works in either shell" I meant that the command
If you clear the value in the settings UI, it's replaced with |
Definitely, that all makes sense. 9223 is going to be really cool once we can validate it. It makes us completely ignore In short, this will finally work:
|
ConptyConnection has two different failure modes: 1. We failed to initialize the pseudoconsole or create the process 2. The process exited with an error code. Until this commit, they were treated the same way: closeOnExit=always would force the pane/tab to be destroyed. This was very bad in case 1, where we would display a (possibly useful) error message and then immediately close the window. This was made even worse by the change in #10045. We removed startingDirectory validation and promoted it to an error message (so that we could eventually let the connection handle startingDirectory in its own way.) This of course revealed that a number of users had set invalid starting directories… and those users included some who set closeOnExit to always. Boom: instant "terminal opens and crashes"¹ ¹ It only looks like a crash; it's actually _technically_ functioning properly. Closes #10225.
ConptyConnection has two different failure modes: 1. We failed to initialize the pseudoconsole or create the process 2. The process exited with an error code. Until this commit, they were treated the same way: closeOnExit=always would force the pane/tab to be destroyed. This was very bad in case 1, where we would display a (possibly useful) error message and then immediately close the window. This was made even worse by the change in #10045. We removed startingDirectory validation and promoted it to an error message (so that we could eventually let the connection handle startingDirectory in its own way.) This of course revealed that a number of users had set invalid starting directories… and those users included some who set closeOnExit to always. Boom: instant "terminal opens and crashes"¹ In this commit, we introduce detection for a connection that fails before it's been established. When that happens, we will ignore the user's closeOnExit mode. ¹ It only looks like a crash; it's actually _technically_ functioning properly. Closes #10225.
I met the same problem that it does not have access to "..\dir%Workspaces%".That's ok, and I just modify "%Workspaces%" to "/". |
ConptyConnection has two different failure modes: 1. We failed to initialize the pseudoconsole or create the process 2. The process exited with an error code. Until this commit, they were treated the same way: closeOnExit=always would force the pane/tab to be destroyed. This was very bad in case 1, where we would display a (possibly useful) error message and then immediately close the window. This was made even worse by the change in #10045. We removed startingDirectory validation and promoted it to an error message (so that we could eventually let the connection handle startingDirectory in its own way.) This of course revealed that a number of users had set invalid starting directories… and those users included some who set closeOnExit to always. Boom: instant "terminal opens and crashes"¹ In this commit, we introduce detection for a connection that fails before it's been established. When that happens, we will ignore the user's closeOnExit mode. ¹ It only looks like a crash; it's actually _technically_ functioning properly. Closes #10225. (cherry picked from commit 31d78dc)
🎉This issue was addressed in #10263, which has now been successfully released as Handy links: |
🎉This issue was addressed in #10263, which has now been successfully released as Handy links: |
Windows Terminal version (or Windows build number)
1.8.1444.0
Other Software
No response
Steps to reproduce
Adjust the startingDirectory to the name of a directory that doesn't exist. Then launch Windows Terminal. That's it.
Expected Behavior
I was expecting an error message saying that the directory doesn't exist. This could be printed to the console or it could be a dialog. Ideally Windows Terminal would still launch since otherwise there is no clear way for me to fix this broken setting.
Actual Behavior
The Windows terminal window flashes and then closes. There is no indication of what the problem is and, unless you have memorized the path to the settings file, no way to fix the problem.
This issue can easily happen if you delete a directory or if you copy settings from one machine to another.
The text was updated successfully, but these errors were encountered: