ubuntu tab 自动补全失效

现象

没有修改.bashrc文件,共用一台机器的小伙伴也没有对系统的bashrc文件的进行修改。tab的自动补全功能莫名其妙的失效。

使用tab自动补全时,显示如下内容(仅粘贴部分内容)

+ _init_completion
+ local exclude= flag outx errx inx OPTIND=1
+ getopts n:e:o:i:s flag
+ COMPREPLY=()
+ local 'redir=@(?([0-9])<|?([0-9&])>?(>)|>&)'
+ _get_comp_words_by_ref -n '<>&' cur prev words cword
+ local exclude flag i OPTIND=1
+ words=()
+ local cur cword words
+ upargs=()
+ upvars=()
+ local upargs upvars vcur vcword vprev vwords
+ getopts c:i:n:p:w: flag -n '<>&' cur prev words cword
+ case $flag in
+ exclude='<>&'
+ getopts c:i:n:p:w: flag -n '<>&' cur prev words cword
+ [[ 6 -ge 3 ]]
+ case ${!OPTIND} in
+ vcur=cur
+ let 'OPTIND += 1'
+ [[ 6 -ge 4 ]]
+ case ${!OPTIND} in
+ vprev=prev
+ let 'OPTIND += 1'
+ [[ 6 -ge 5 ]]
+ case ${!OPTIND} in
+ vwords=words
+ let 'OPTIND += 1'
+ [[ 6 -ge 6 ]]
+ case ${!OPTIND} in
+ vcword=cword
+ let 'OPTIND += 1'
+ [[ 6 -ge 7 ]]
+ __get_cword_at_cursor_by_ref '<>&' words cword cur
+ words=()
+ local cword words
...

问题测试

在网上搜索到使用命令env -i bash --noprofile --norc, 进行测试,查看tab自动补全是否可以使用。
tab键可正常使用, env -i bash --norc尝试使用该命令,tab自动补全已经可以正常使用。

解决办法

使用env -i bash设置bash, tab补全功能可正常使用了

ps

使用的tmux开了多个终端,不知道是不是tmux的问题。

参考
[1] https://itectec.com/ubuntu/ubuntu-no-tab-completion-with-asterisk/

相关文章

ubuntu退出redis的示例:指定配置文件方式启动源码redis:roo...
ubuntu中mysql改密码忘了的解决方法:1.在终端中切换到root权...
ubuntu安装mysql失败的解决方法原因:可能是原有的MySQL还有...
使用centos和ubuntu建站的区别有以下几点1.CentOS是Linux发行...
ubuntu图形界面和字符界面切换的方法:可以通过快捷键CTRL+A...
ubuntu中重启mysql失败的解决方法1.首先,在ubuntu命令行中,...