如何对ksh93编程以使用bash自动完成功能? [英] How can I program ksh93 to use bash autocompletion?
问题描述
在针对shell问题的评论中,用户 tinkertim 说,很容易破解ksh
来使用bash
自动完成库.我没有什么比在AT& T ksh93
中使用bash
自动完成功能更好的了.该怎么办?
In a comment in response to a shell question, user tinkertim said that it was easy to hack ksh
to use the bash
autocompletion library. I would like nothing better than to use bash
autocompletion with AT&T ksh93
. How can this be done?
ksh93
每年有几次新版本发布,因此我正在寻找不涉及修改源代码的解决方案. ksh93
可以动态链接新的C模块,并且具有高度的可编程性(我在每次击键时都运行ksh函数),因此实际上不需要修改源代码.
ksh93
has a new release several times a year, so I am looking for a solution that does not involve modifying the source code. ksh93
can link new C modules dynamically and also is highly programmable (I run a ksh function at every keystroke), so modifying the source should not really be necessary.
注意:我不是在说文件名自动补全,这在ksh
中很容易做到.我正在谈论bash所做的所有其他美味的自动完成功能,例如nmh
命令的自动完成选项或自动完成Mercurial的命令.这样的东西.
Note: I am not talking about filename autocompletion, which is easy to do in ksh
. I'm talking about all the other yummy autocompletion stuff that bash does, like autocompletion options for nmh
commands or autocompleting Mercurial commmands. Stuff like that.
推荐答案
绑定tab键以调用使用内置complete
的bash脚本,因此在ksh93中点击tab实际上会运行bash来完成文本.
Bind the tab key to call a bash script which uses the complete
builtin, so hitting tab in ksh93 actually runs bash to complete the text.
咨询 http://www.gnu .org/software/bash/manual/html_node/Programmable-Completion-Builtins.html#Programmable-Completion-Builtins 和 http://www2.research.att.com/sw/download /man/man1/ksh.html (查找键绑定")以获取详细信息
Consult http://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html#Programmable-Completion-Builtins and http://www2.research.att.com/sw/download/man/man1/ksh.html (look for "Key Bindings") for details
这篇关于如何对ksh93编程以使用bash自动完成功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!