我知道为了在期望脚本中发送返回,我会执行以下操作:
send -- "\r"
What is the send command for the INSERT and F12 keys? I've looked online and cannot find it anywhere.
不得不说最初接受的answer https://stackoverflow.com/revisions/50583731/2不正确,因为
- 对于不同的终端类型,真实的字符序列并不相同;
-
send -- "[2~"
is wrong because
-
[
在 Tcl 中具有特殊含义(命令替换),因此应该使用反斜杠转义;
- The ESC char (
\E
as in infocmp
's output) is missing;
正确的做法:
set kf12 [exec tput kf12]
set kins [exec tput kich1]
... ...
send $kf12
如果需要手动指定 TERM 类型,请使用tput -T http://man7.org/linux/man-pages/man1/tput.1.html:
对于魔法弦kf12
and kich1
, 搜索在术语信息手册 http://man7.org/linux/man-pages/man5/terminfo.5.html page.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)