当我运行终端并在输入命令开头后键入os.tmpdir()
时,不会弹出任何内容。但是,在该终端中运行Tab
后,我会收到完成建议。
以下代码段位于我的. /etc/bash_completion
文件中:
.bashrc
Online,我看到有关此代码段的信息实际上应该是激活bash_completion的内容。
我的问题是,我采取了哪些措施来确保为此正确设置所需的一切?
代码参考更新:
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi