shi*_*ang 18 bash tab-completion
Bash选项卡完成在第一次完成后添加额外空间,如果compeletion目标是多级文件夹中的文件,则停止进一步完成.
例如,我在路径〜/ Documents/foo/bar.txt中有一个文件,我想列出它.输入时我遇到以下问题
a@b:~$ls Docu <TAB>
Run Code Online (Sandbox Code Playgroud)
我明白了
a@b:~$ls Documents |(<-this is the cursor, so there is an extra space afer Documents)
Run Code Online (Sandbox Code Playgroud)
所以我无法进一步完成标签.我必须退格以删除额外的空间.
通常我想得到:
a@b:~$ls Docu <TAB>
a@b:~$ls Documents/ <TAB>
a@b:~$ls Documents/foo/ <TAB>
a@b:~$ls Documents/foo/bar.txt
Run Code Online (Sandbox Code Playgroud)
tlo*_*tlo 21
仅供记录:adobereader-enu(acroread)包中还有一个错误,可以打破bash完成.在这种情况下,您只需删除符号链接:
rm /etc/bash_completion.d/acroread.sh
Run Code Online (Sandbox Code Playgroud)
另见:https://bugs.launchpad.net/ubuntu/+source/acroread/+bug/769866
小智 6
在Ubuntu 11.10和12.04中,我的bash完成也遇到了同样的问题.我发现通过编辑/ etc/bash_completion我可以获得许多命令来开始正常工作.具体来说,我评论了以下部分:
####
# makeinfo and texi2dvi are defined elsewhere.
#
#for i in a2ps awk bash bc bison cat colordiff cp csplit \
# curl cut date df diff dir du enscript env expand fmt fold gperf gprof \
# grep grub head indent irb ld ldd less ln ls m4 md5sum mkdir mkfifo mknod \
# mv netstat nl nm objcopy objdump od paste patch pr ptx readelf rm rmdir \
# sed seq sha{,1,224,256,384,512}sum shar sort split strip tac tail tee \
# texindex touch tr uname unexpand uniq units vdir wc wget who; do
# have $i && complete -F _longopt -o default $i
#done
Run Code Online (Sandbox Code Playgroud)
现在我再次运作良好.我还没弄清楚为什么mv仍然是错误的行为.
| 归档时间: |
|
| 查看次数: |
5168 次 |
| 最近记录: |