scop / bash-completion

Programmable completion functions for bash
GNU General Public License v2.0
2.8k stars 376 forks source link

Readline colors command completions as files (red blinking text) #1161

Closed MayeulC closed 2 months ago

MayeulC commented 2 months ago

Describe the bug

When completing commands, suggestions are displayed. However, readline considers them to be files. Since my configuration colors completed files by type (folder, executable, etc), readline runs a stat operation on the completions, and usually does not find matching files. It then colors them as missing files.

The result is that all command completions are listed as blinking bold white text on red background in my terminal, which is very annoying.

To reproduce

With bash-completion loaded:

  1. echo "set colored-stats On" >> ~/.inputrc
  2. Open a new terminal
  3. Start a completion such as ls --<TAB><TAB>

Expected behavior

Text should be displayed in a neutral manner, or just respecting the menu-color-display-prefix

Versions (please complete the following information)

Additional context

Tab completing bash variables does not highlight them as if they were files.

Interesting thread on RedHat/Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1648170

Small related thread on gentoo forums: https://forums.gentoo.org/viewtopic-p-8628015.html

Text is not necessarily going to blink, depending on your LS_COLORS, terminal, etc. But it is probably still highlighted as a missing file, like as a missing symlink target.

akinomyoga commented 2 months ago

The problem arises even with the plain Bash (without loading bash-completion or any other shell settings). This is an issue of the upstream Bash.

image

MayeulC commented 2 months ago

Ah, I see, thank you. This can probably be closed then ?

akinomyoga commented 2 months ago

Yeah. To report it upstream, you can post an email to bug-bash@gnu.org.