Question

I've ran into a few cases where powershell ISE will freeze when you try to kill a process with Ctrl+C. I can still move my cursor around the console but the status is stuck on "Stopping".

This has happened for several commands but one particular command I've noticed this consistently happening for is

mvn jasmine:bdd

This command runs a maven plugin which starts a jetty server. I can stop this with Ctrl+C from Powershell Console but not from Powershell ISE. Could this be related to the fact that Powershell ISE can't run interactive commands?

Right now my workaround is to just "start" maven in another process. Anyone else run into a similar problem?

Thanks

Était-ce utile?

La solution

I opened case for Powershell team while referencing this issue.

https://github.com/PowerShell/PowerShell/issues/7970

Seems like recommended way is to use VS Code with Powershell.

Also this can help https://docs.microsoft.com/en-us/powershell/scripting/core-powershell/vscode/using-vscode?view=powershell-6

Autres conseils

You may need to explicitly write the script to capture Ctrl-C as input. Found an circa 2014 post on Technet that seems to address a very similar phenomenon. Cannot speak the validity of the 'answer', but one of the links in the thread will take you down a bit of a rabbit-hole of other links with possible workarounds.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top