zsh/bash 有没有办法打印出下一个收到的击键的键映射?
我按下键盘上的一个组合键,它就会打印出来,说
键盘映射:
^A
答案1
/bin/cat -v
会做你想做的事。
来自 cat(1) 手册页:
如果没有 FILE,或者 FILE 为 -,则读取标准输入。
-v, --show-nonprinting
use ^ and M- notation, except for LFD and TAB
答案2
我找到了这个
http://www.catb.org/~esr/showkey/
A simple keystroke visualizer
All this program does is read keystrokes and spit them back at you in
a simple, printable form. This is one of these silly little utilities
that you never think you'll need until some unexpected situation pops
up and you have to have it. Then you get to be mugged by the details
of tty-interface code, yippee. Never again!