我不明白bind -P
命令的输出。字符是什么意思-
"\C-g", "\C-x\C-g", "\e\C-g
"\e-", "\e0", "\e1", "\e2", "\e3", ...
请解释。
谢谢!
我不明白bind -P
命令的输出。字符是什么意思-
"\C-g", "\C-x\C-g", "\e\C-g
"\e-", "\e0", "\e1", "\e2", "\e3", ...
请解释。
谢谢!
"\C-g"
- Ctrl- g- 中止"\C-x\C-g"
- Ctrl- x- Ctrl- g- 中止"\e\C-g
- Esc- Ctrl- g- 中止"\e-"
- Esc- -- 计数参数以负数开头"\e0"
- Esc- 0- 计数参数的数字"\e1"
- Esc- 1- 一样"\e2"
- Esc- 2- 一样"\e3"
- Esc- 3- 一样查看man readline
更多信息
根据 bash 的手册页,-P
开关执行以下操作:
List current Readline function names and bindings.
Readline 是一个与 bash (通常)集成的库。-P
因此,开关中的绑定是运行相关的 readline 函数所必需的键盘组合。因此,例如:
... snip ...
beginning-of-line can be found on "\eOH", "\e[H".
call-last-kbd-macro is not bound to any keys
capitalize-word is not bound to any keys
character-search is not bound to any keys
character-search-backward is not bound to any keys
clear-screen is not bound to any keys
complete can be found on "\C-i".
... snip ...
这表明该函数complete
绑定到组合键,该组合键"\C-i"
是 control-i 的简写。\C
诸如此类的字符是显示为控制代码的元键。