Ctrl + c 不适用于 Linux 上的某些应用程序

Ist*_*van 2 linux ssh command-line-interface terminal

这是一个非常奇怪的问题,但在新系统(Fedora、Ubuntu)上 ctrl+c 对某些工具无效:

如果我执行运行近一分钟的 yum list 我不能中断运行 ctrl+c

$time yum list >/dev/null
^C^C^C^C^C^C^C^C^C
Run Code Online (Sandbox Code Playgroud)

命令执行不会停止。

然而,中断查找是可能的。

$ time find / >/dev/null 2>&1
^C

real    0m0.741s
user    0m0.033s
sys     0m0.124s
Run Code Online (Sandbox Code Playgroud)

我很好奇是什么原因造成的。

我必须进行以下设置:

$ stty -a
speed 38400 baud; rows 36; columns 158; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
Run Code Online (Sandbox Code Playgroud)

我还没有找到问题的描述,如果有人愿意提供一些线索,我很感激。

提前致谢。

Ign*_*ams 9

一些应用程序会SIGINT因为与其他库的奇怪交互而陷入困境。您可以尝试向他们发送一个SIGQUIT(通过Ctrl\您的stty输出给出)。