简体   繁体   English

Powershell ISE在杀戮过程中冻结

[英]Powershell ISE freezes while killing process

I've ran into a few cases where powershell ISE will freeze when you try to kill a process with Ctrl+C. 我遇到过一些情况,当你试图用Ctrl + C杀死一个进程时,PowerShell ISE会冻结。 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. 此命令运行maven插件,启动jetty服务器。 I can stop this with Ctrl+C from Powershell Console but not from Powershell ISE. 我可以使用Powershell控制台的Ctrl + C来停止此操作,但不能从Powershell ISE停止。 Could this be related to the fact that Powershell ISE can't run interactive commands? 这可能与Powershell ISE无法运行交互式命令这一事实有关吗?

Right now my workaround is to just "start" maven in another process. 现在我的解决方法是在另一个进程中“启动”maven。 Anyone else run into a similar problem? 其他人遇到类似的问题?

Thanks 谢谢

I opened case for Powershell team while referencing this issue. 我在参考此问题时为Powershell团队打开了案例。

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

Seems like recommended way is to use VS Code with Powershell. 似乎推荐的方法是使用带有Powershell的VS Code。

Also this can help https://docs.microsoft.com/en-us/powershell/scripting/core-powershell/vscode/using-vscode?view=powershell-6 这也可以帮助https://docs.microsoft.com/en-us/powershell/scripting/core-powershell/vscode/using-vscode?view=powershell-6

You may need to explicitly write the script to capture Ctrl-C as input. 您可能需要显式编写脚本以捕获Ctrl-C作为输入。 Found an circa 2014 post on Technet that seems to address a very similar phenomenon. 在Technet上发现了大约2014年的帖子 ,似乎解决了一个非常相似的现象。 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. 不能说'答案'的有效性,但是线程中的一个链接会让你失去一些其他链接的兔子洞,可能有解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM