How to modify the bash completion "character-threshold"?

I’d like to experiment with the bash completion starting from two typed characters — currently three have to be typed in, this essentially saves no time with some commands such as yt-dlp. Since I mainly manage files from the command-line this would save a bit of time with unique filenames (within their directory).

I assume that there won’t be any global performance impact (i.e. auto-completion for three or more chars would be unaffected).

1 Like

Can you clarify what you mean by “three have to be typed in” please? On my system, I can just type a and hit tab twice, and it’ll ask me if I want to see all possible options (because there are too many of them), so even one letter is quite sufficient here.

For, y, i type in y, and hit tab twice, and it shows all options for me to pick from:

$ y
yacc                yes                 ykinfo              ypdomainname@       yum-builddep@       yum-debug-restore@
yaml2obj            ykchalresp          ykparse             yt-dlp              yum-config-manager@ yumdownloader@
yelp                ykgenerate          ykpersonalize       yum@                yum-debug-dump@     yum-groups-manager@
1 Like

The confusion seems to stem from a leftover ytdl binary I had in ~/.local/bin/ — I appear to have never hit the Tab key twice in this context and assumed that Fedora works differently from other distros and Termux (Android). I can also certainly auto-complete filenames with one Tab-hit after all.

It may be better to remove this question as misleading, or lock at least.

ytdl --version
Traceback (most recent call last):
  File "/home/user/.local/bin/ytdl", line 22, in <module>
    import pafy
ModuleNotFoundError: No module named 'pafy'
1 Like