Open leoarnold opened 2 years ago
Suppressing error output from underlying invoked commands is a "cheap" general practice we tend to follow, because letting it through may cause an interleaved error/completion mess, the errors may make no sense to users, and/or presence of various commands or support for args we invoke them with might not be essential for the completion to work (graceful degradation).
I'm not against improving on this practice, but we should establish a way to do it so it's clear what and where is suppressed intentionally, and what's just an oversight. Maybe this means just some documentation and comments on the matter. Maybe it would be useful to make suppression optional, e.g. skip it in a "debug mode". Anyway it will require careful examination of each case separately.
For example, related to this particular case: for better or for worse, we still support the version of apt-cache
that is present on Ubuntu 14.04. It doesn't understand the --no-generate
option, so if we just let the error output through, it'll be mostly just an annoyance to users. Such a version of apt-cache
isn't probably that relevant these days as far as new releases of bash-completion go, and our support for it is mostly a side effect of us running tests on Ubuntu 14.04 to cover oldish bash versions, but to illustrate.
Hi there,
just installed Kubuntu 22.04.1 Desktop and noticed that
would autocomplete, but
would not.
Reporting it here as a reference. May already be fixed in current development state.
Describe the feature/solution
I looked into the code of the version packaged with Ubuntu 18.04 and found the line
So I ran
which was weird because
sudo apt-get update
passed without error.The solution was to purge the cache and refresh:
and tab completion worked again.
Would be nice if that error message was not silently swallowed by the completion though.
Maintenance (please complete the following information)