关于停止命令行过程的疑问
我发现,当我
a = 1:a
a
在命令行中执行时,我可以按CTRL+C停止无限过程。
但是,当我执行时,Ctrl+C无法停止该过程,
length a
但是当我执行CTRL+C时,Ctrl+C效果很好,
length [0..]
为什么有时会无法停止该过程?当Ctrl+C无效时,有什么方法可以停止该过程?
I found that when I execute
a = 1:a
a
in command line, I can press Ctrl+c to stop the infinite process.
But Ctrl+c fails to stop the process when I execute
length a
However, Ctrl+c works well when I execute
length [0..]
Why does Ctrl+c sometimes fail to stop the process? Is there any ways to stop the process when Ctrl+c is invalid?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在Windows下,有一个错误,在按下CTRL + C之后,GHCI似乎退出,但似乎仍在后台运行。我唯一能找到的文档是 https://gitlab.hask.hask.org.org/ghc/ghc/ghc/ghc/ghcghc/ghcghc/ghcghc /ghc/ - /essess/14150 ,但是我自己使用9.2.1.使用无限数据结构(如无限列表)来多次体验了它[1 ..]。
Under Windows, there is a bug where, after pressing Ctrl + C, GHCI appears to exit but still seems to run in the background. The only documentation I could find is https://gitlab.haskell.org/ghc/ghc/-/issues/14150 but I've experienced it myself multiple times using version 9.2.1.when working with infinite data structures like infinite lists [1..].