-
Notifications
You must be signed in to change notification settings - Fork 87
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
Open cmd when running inside PowerShell #494
Conversation
As of today, when VSCode default's terminal is PowerShell, running a maven command opens a new cmd window, and when the process is finished, this window is closed and we can't see what happened. With this change, we force PowerShell to run the command in it's own window.
Also reported in #489 , but I was not able to reproduce the bug. BTW, the "cmd /c" trick was to cover some corner case (if I don't remember wrong). I'll let you know when I find out the back-story. |
I think I found something that could help to understand the issue. In my settings.json, the configurations relative to java and maven are: This way, a new cmd window pops out and closes as soon as the execution ends, therefore I can't see what happened. I found out that when I reference the .cmd version of mvn, the results are printed to PS terminal window, without opening a new one. So, that's why the "cmd /c" works! When running "cmd /c", even if we don't put .cmd, it reached for mvn.cmd. |
I find the story. Before PR #455 , we do have "cmd /c" . You may take a look at it if you have interest. Anyway, now since it's breaking your case, I agree that we add it back. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! We'll add your case into the test plan in case of any regression.
@arpontes To fix the issue you mentioned, what I'm thinking now is:
|
@Eskibear actually, the problem is the enclosing quotes. I created a series of folders with an .cmd file that contains only a "dir". Then I start to test some parameters, and the problem arose: The problem is solved if we enclose all the command in quotes (scaping the original quotes): The same worked with maven: Actually, this was the right way to call cmd in order to be a single command - including the parameters |
Thanks for the information, and it helps me understand more about the behavior. |
As of today, when VSCode default's terminal is PowerShell, running a maven command opens a new cmd window, and when the process is finished, this window is closed and we can't see what happened.
With this change, we force PowerShell to run the command in it's own window.