原因具体不清楚。
方法:
- 看你用的是什么,像window terminal可以设置键绑定。
- 像shell ,如zsh 的可以设置key -binding
- 有些跟stty有关。输入stty sane 即可。详见链接
- 你可以使用cat命令查看你当前的代码:To know the code of a key, execute cat, press enter, press the key, then Ctrl+C.
sane Same as cread -ignbrk brkint -inlcr -igncr icrnl -iutf8 -ixoff -iuclc -ixany imaxbel 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, all special characters to their default values.
源文档:https://www.computerhope.com/unix/ustty.htmhttps://www.computerhope.com/unix/ustty.htm