-
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
Terminal crashes on wt .
#12535
Comments
Just got another error.
|
|
Yes, the argument after You need to use |
If that is the case, then what about programs that use Windows Terminal without making sure the target binary exists? |
It should always display an error (as you noted in your second comment) in a new terminal tab/window/pane. If it crashes, that is a bug we should fix. |
## Summary of the Pull Request Prevents a crash that could occur when invoking `wt C:\` ## PR Checklist * [x] Closes #12535 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments Updates `CascadiaSettings::NormalizeCommandLine()` to check that there are a suitable number of command line arguments to be concatenated together, to prevent accessing an array index in `argv` that doesn't exist. Also prevents a test flake that could occur in `TerminalSettingsTests::CommandLineToArgvW()`, due to generating an empty command line argument. ## Validation Steps Performed Added a test, and checked that invoking each of the command lines below behaved as expected: ``` wtd C:\ # Window pops up with [error 2147942405 (0x80070005) when launching `C:\'] wtd C:\Program Files # Window pops up with [error 2147942402 (0x80070002) when launching `C:\Program Files'] wtd cmd # cmd profile pops up wtd C:\Program Files\Powershell\7\pwsh -WorkingDirectory C:\ # PowerShell profile pops up in C:\ wtd "C:\Program Files\Powershell\7\pwsh" -WorkingDirectory C:\ # PowerShell profile pops up in C:\ wtd . # Window pops up with [error 2147942405 (0x80070005) when launching `.'] ```
## Summary of the Pull Request Prevents a crash that could occur when invoking `wt C:\` ## PR Checklist * [x] Closes #12535 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments Updates `CascadiaSettings::NormalizeCommandLine()` to check that there are a suitable number of command line arguments to be concatenated together, to prevent accessing an array index in `argv` that doesn't exist. Also prevents a test flake that could occur in `TerminalSettingsTests::CommandLineToArgvW()`, due to generating an empty command line argument. ## Validation Steps Performed Added a test, and checked that invoking each of the command lines below behaved as expected: ``` wtd C:\ # Window pops up with [error 2147942405 (0x80070005) when launching `C:\'] wtd C:\Program Files # Window pops up with [error 2147942402 (0x80070002) when launching `C:\Program Files'] wtd cmd # cmd profile pops up wtd C:\Program Files\Powershell\7\pwsh -WorkingDirectory C:\ # PowerShell profile pops up in C:\ wtd "C:\Program Files\Powershell\7\pwsh" -WorkingDirectory C:\ # PowerShell profile pops up in C:\ wtd . # Window pops up with [error 2147942405 (0x80070005) when launching `.'] ```
## Summary of the Pull Request Prevents a crash that could occur when invoking `wt C:\` ## PR Checklist * [x] Closes #12535 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments Updates `CascadiaSettings::NormalizeCommandLine()` to check that there are a suitable number of command line arguments to be concatenated together, to prevent accessing an array index in `argv` that doesn't exist. Also prevents a test flake that could occur in `TerminalSettingsTests::CommandLineToArgvW()`, due to generating an empty command line argument. ## Validation Steps Performed Added a test, and checked that invoking each of the command lines below behaved as expected: ``` wtd C:\ # Window pops up with [error 2147942405 (0x80070005) when launching `C:\'] wtd C:\Program Files # Window pops up with [error 2147942402 (0x80070002) when launching `C:\Program Files'] wtd cmd # cmd profile pops up wtd C:\Program Files\Powershell\7\pwsh -WorkingDirectory C:\ # PowerShell profile pops up in C:\ wtd "C:\Program Files\Powershell\7\pwsh" -WorkingDirectory C:\ # PowerShell profile pops up in C:\ wtd . # Window pops up with [error 2147942405 (0x80070005) when launching `.'] ``` (cherry picked from commit 722aafa)
🎉This issue was addressed in #12538, which has now been successfully released as Handy links: |
🎉This issue was addressed in #12538, which has now been successfully released as Handy links: |
ive made it work by using %~dp0 , been trying different things for this for hours yesterday! 🥳 |
Windows Terminal version
1.12.10393.0
Windows build number
19043.1469
Other Software
Steps to reproduce
wt .
in Command Prompt.(May also happen with Git Bash)
Expected Behavior
I was expecting to have Windows Terminal open in the current directory.
Actual Behavior
Windows Terminal crashed and I lost about 30 minutes of work.
The text was updated successfully, but these errors were encountered: