在 zsh 中当我尝试按下时CTRL-C
什么也没有发生(在 bash 中运行良好)当我运行时bindkey | grep \\^C
我得到"^C" Applications
所以一定发生了一些事情......我如何绑定^-C
到默认值?
答案1
stty sane
通常是一个很好的起点;在zsh
命令行编辑器之外,它是终端驱动程序的一个功能。
答案2
答案3
就我而言,有些东西改变了 zsh 中断键(内)到 Control-G。要修复它:
stty intr ^C
(stty sane
不工作。)
更多详情:
% stty -a | grep intr
eol2 = <undef>; erase = ^?; intr = ^G; kill = ^U; lnext = ^V;
% # Control-C did not work. So I used Control-Z to stop the ping:
% ping 1.2.3.4
PING 1.2.3.4 (1.2.3.4): 56 data bytes
Request timeout for icmp_seq 0
^CRequest timeout for icmp_seq 1
^CRequest timeout for icmp_seq 2
^Z
zsh: suspended ping 1.2.3.4
% stty intr ^C
% stty -a | grep intr
eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
# Control-C is working again. Yes!
% ping 1.2.3.4
PING 1.2.3.4 (1.2.3.4): 56 data bytes
Request timeout for icmp_seq 0
^C
--- 1.2.3.4 ping statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss
答案4
ls
我只是通过按下 ctrl-c、ctrl-c 后输入简单的命令解决了这种情况。
我想我处于某种多行输入模式。