关于停止命令行过程的疑问

发布于 2025-02-05 00:45:01 字数 264 浏览 2 评论 0原文

我发现,当我

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

掩饰不了的爱 2025-02-12 00:45:02

在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..].

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文