用于Windows cmd行的Linux类Ctrl-C(KeyboardInterrupt)?

时间:2021-10-20 22:43:03

I've been forced into using a command line in windows and wondered if there were Linux-like keyboard shortcuts? I googled and didn't find what I was looking for.

我*在Windows中使用命令行,并想知道是否有类似Linux的键盘快捷键?我用Google搜索,但没找到我要找的东西。

Things like ^C, ^Z and such? Thanks all!

像^ C,^ Z之类的东西?谢谢大家!

4 个解决方案

#1


You can trap ^C on Windows with SIGINT, just like Linux. The Windows shell, such as it is, doesn't support Unix style job control (at least not in a way analogous to Unix shells), and ^Z is actually the ^D analog for Windows.

您可以使用SIGINT在Windows上捕获^ C,就像Linux一样。 Windows shell,例如它,不支持Unix风格的作业控制(至少不是类似于Unix shell的方式),而^ Z实际上是Windows的^ D模拟。

#2


Try Ctrl+Break: some programs respond to it instead of Ctrl+C. On some keyboards Ctrl+Break translates to Ctrl+Fn+Pause.

尝试Ctrl + Break:某些程序会响应它而不是Ctrl + C.在某些键盘上,Ctrl + Break会转换为Ctrl + Fn + Pause。

Note also that nothing can cancel synchronous network I/O (such as net view \\invalid) on Windows before Vista.

另请注意,在Vista之前,Windows上没有任何内容可以取消同步网络I / O(例如网络视图\\无效)。

#3


There are two keyboard combinations that can be used to stop process in Windows command line.

有两种键盘组合可用于在Windows命令行中停止进程。

  • Ctrl+C is the "nicer" method. Programmers can handle this in software. It's possible to write programs that ignore Ctrl+C as SIGINT signal completely, or handle Ctrl+C like a regular keyboard combination.

    Ctrl + C是“更好”的方法。程序员可以用软件来处理。可以编写完全忽略Ctrl + C作为SIGINT信号的程序,或像普通键盘组合一样处理Ctrl + C.

  • Ctrl+break is the "harder" method, always sends SIGBREAK signal and cannot be overridden in software.

    Ctrl + break是“更难”的方法,总是发送SIGBREAK信号,不能在软件中覆盖。

#4


Ctrl-C does a similar thing in windows as it does in linux.

Ctrl-C在Windows中执行与在linux中类似的操作。

#1


You can trap ^C on Windows with SIGINT, just like Linux. The Windows shell, such as it is, doesn't support Unix style job control (at least not in a way analogous to Unix shells), and ^Z is actually the ^D analog for Windows.

您可以使用SIGINT在Windows上捕获^ C,就像Linux一样。 Windows shell,例如它,不支持Unix风格的作业控制(至少不是类似于Unix shell的方式),而^ Z实际上是Windows的^ D模拟。

#2


Try Ctrl+Break: some programs respond to it instead of Ctrl+C. On some keyboards Ctrl+Break translates to Ctrl+Fn+Pause.

尝试Ctrl + Break:某些程序会响应它而不是Ctrl + C.在某些键盘上,Ctrl + Break会转换为Ctrl + Fn + Pause。

Note also that nothing can cancel synchronous network I/O (such as net view \\invalid) on Windows before Vista.

另请注意,在Vista之前,Windows上没有任何内容可以取消同步网络I / O(例如网络视图\\无效)。

#3


There are two keyboard combinations that can be used to stop process in Windows command line.

有两种键盘组合可用于在Windows命令行中停止进程。

  • Ctrl+C is the "nicer" method. Programmers can handle this in software. It's possible to write programs that ignore Ctrl+C as SIGINT signal completely, or handle Ctrl+C like a regular keyboard combination.

    Ctrl + C是“更好”的方法。程序员可以用软件来处理。可以编写完全忽略Ctrl + C作为SIGINT信号的程序,或像普通键盘组合一样处理Ctrl + C.

  • Ctrl+break is the "harder" method, always sends SIGBREAK signal and cannot be overridden in software.

    Ctrl + break是“更难”的方法,总是发送SIGBREAK信号,不能在软件中覆盖。

#4


Ctrl-C does a similar thing in windows as it does in linux.

Ctrl-C在Windows中执行与在linux中类似的操作。