1

How to change completion coloring when auto-completing subcommands in bash?enter image description here

For unknown reason, it looks like the completion results are treated by bash as broken symlinks. And it looks really disturbing.

System info:

  • Bash version: 4.4.23(1)-release
  • OS: Manjaro Linux

Edit: I understand that by setting off the colored-stats GNU Readline option in ~/.inputrc the coloring will be turned off altogether:

set colored-stats off

But that would also disable other coloring, such as for directory, when auto-completing.

I think this is weird because the broken-symlink-like coloring happens on my Manjaro Linux box at home, but not my Arch Linux box at work. Both are applied with the same bashrc and inputrc. But I didn't check for other potential difference for now.


Edit again: Pasting my ~/.inputrc for reference:

$include /etc/inputrc
$if mode=emacs
# cycle through possible completions
TAB: menu-complete
# complete until the end of common prefix before cycling through possible completions
set menu-complete-display-prefix on
# show possible completions if more than one completions are possible
set show-all-if-ambiguous on
set show-all-if-unmodified on
# do not duplicate characters after the cursor if they consist partially of possbile completion
set skip-completed-text on
# display colors when doing completion as `ls` does
set colored-stats on
# color tab-completion matched prefix part
set colored-completion-prefix on
# fuck off stty key bindings. (stty -a)
set bind-tty-special-chars off
"\C-w": unix-word-rubout
"\eh": kill-region
"\eH": copy-region-as-kill
"\C-x\'": "\'\'\C-b"
"\C-x`": "``\C-b"
"\C-x\"": "\"\"\C-b"
"\C-x{": "{}\C-b"
"\C-x[": "[]\C-b"
"\C-x(": "()\C-b"
"\C-x0": vi-eWord
"\eF": "\C-x0\C-f"
"\eB": vi-bWord
"\eD": "\e \eF\eh"
$endif 
  • I'm trying to understand this as well. My assumption is that something in the way it presents the output is assuming that it's a local file and so is treating it as "missing", but I don't know why yet. It would be good if it just showed them as plain text! – IBBoard Dec 6 '18 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.