cd 自动完成显示大量信息

cd 自动完成显示大量信息

我在学校使用很多文件夹来组织我的课程,而且我经常会将一个文件夹单独放在另一个文件夹中,因为我知道将来我会添加更多文件夹。例如 Folder0 -> Folder1 单独 -> 多个文件。

我的问题是,当我cd尝试在 shell 中使用 Tab 自动完成而没有任何内容时,它显示的内容比预期的多得多,因此无法直接工作,如此屏幕截图所示。

在此处输入图片描述

这是正常的吗?如果是,我该如何禁用它,以便我可以直接自动完成到我的唯一文件夹中?

已经谢谢了

编辑:这是我的 ~/.bashrc 文件的内容。我使用 Terminator 和 Bash-it 一个简单的框架:

cat ~/.bashrc
#!/usr/bin/env bash

# Path to the bash it configuration
export BASH_IT="/home/samuel/.bash_it"

# Lock and Load a custom theme file.
# Leave empty to disable theming.
# location /.bash_it/themes/
export BASH_IT_THEME='bakke'

# (Advanced): Change this to the name of your remote repo if you
# cloned bash-it with a remote other than origin such as `bash-it`.
# export BASH_IT_REMOTE='bash-it'

# Your place for hosting Git repos. I use this for private repos.
export GIT_HOSTING='[email protected]'

# Don't check mail when opening terminal.
unset MAILCHECK

# Change this to your console based IRC client of choice.
export IRC_CLIENT='irssi'

# Set this to the command you use for todo.txt-cli
export TODO="t"

# Set this to false to turn off version control status checking within the prompt for all themes
export SCM_CHECK=true

# Set Xterm/screen/Tmux title with only a short hostname.
# Uncomment this (or set SHORT_HOSTNAME to something else),
# Will otherwise fall back on $HOSTNAME.
#export SHORT_HOSTNAME=$(hostname -s)

# Set Xterm/screen/Tmux title with only a short username.
# Uncomment this (or set SHORT_USER to something else),
# Will otherwise fall back on $USER.
#export SHORT_USER=${USER:0:8}

# Set Xterm/screen/Tmux title with shortened command and directory.
# Uncomment this to set.
#export SHORT_TERM_LINE=true

# Set vcprompt executable path for scm advance info in prompt (demula theme)
# https://github.com/djl/vcprompt
#export VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt

# (Advanced): Uncomment this to make Bash-it reload itself automatically
# after enabling or disabling aliases, plugins, and completions.
# export BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE=1

# Uncomment this to make Bash-it create alias reload.
# export BASH_IT_RELOAD_LEGACY=1

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

# Nodejs
VERSION=v10.16.3
DISTRO=linux-x64
export PATH=/usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin:$PATH



#aliases
alias upgradeall='sudo apt update;sudo apt upgrade'
alias open='xdg-open'

# Load Bash It
source "$BASH_IT"/bash_it.sh




# pip bash completion start
_pip_completion()
{
    COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
                   COMP_CWORD=$COMP_CWORD \
                   PIP_AUTO_COMPLETE=1 $1 ) )
}
complete -o default -F _pip_completion pip
# pip bash completion end

答案1

经过长时间的研究,我终于找到了答案。如果你使用 Bash-It 作为你的 SHELL,请确保使用 禁用系统完成bash-it disable completion system

然后当然重新加载你的 bash 并且你的完成将正常工作而无需显示整个输出compgen-v

相关内容