如何绑定“回车键” [英] how to bind the 'Enter key'
问题描述
于是,我学会了如何使用绑定昨天。
通过键入<大骨节病>控制骨节病> + <大骨节病> v 骨节病>然后在终端的关键,我得到的原始字符重新presents的关键。例如:<大骨节病>控制骨节病> + <大骨节病> v 骨节病>后跟<大骨节病> ESC 骨节病>返回^ [
我的问题是,我该怎么绑定回车键。 Enter键返回^ M但是当我键入命令
绑定'\\ E ^ M:FOOBAR'
pressing回车键不会导致foobar的正在键入我的终端。
绑定'\\ E ^ M:FOOBAR'
绑定逃生 - 输入,无法进入。你只是想
绑定'^ M:FOOBAR'
^ M
必须是实际控制字符,而不是 ^
和 M
。比较容易的类型是
绑定'\\ C-M:FOOBAR'
So I learned how to use bind yesterday.
By typing Ctrl+v followed by a key in the terminal, I get a raw character that represents the key. For example: Ctrl+v followed by Esc returns ^[
My question is, how can I bind the "enter key". The Enter Key returns "^M" but when I type the command
bind '"\e^M":"foobar"'
pressing the enter key does not result in foobar being typed in my terminal.
bind '"\e^M":"foobar"'
binds Escape-Enter, not Enter. You just want
bind '"^M":"foobar"'
^M
must be the actual control character, not ^
and M
. A little easier to type is
bind '"\C-M":"foobar"'
这篇关于如何绑定“回车键”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!