New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tab completion for apt-get install
produces only a subset of options
#9972
Comments
Fixed by 96deaae in master. Before we tried to use |
Aaand unfortunately not - this was based on either a misunderstanding of what /var/lib/dpkg/status is, or a change in its meaning. It will unfortunately only work for installed packages. Anyway, I've gone back to the old way but increased the limit a bit. Unfortunately dpkg's database layout is pretty horrible, and reading it really does take that long. If you want to remove it for yourself, I feel like if you want a list of all packages there are nicer interfaces than the completion pager, so I don't think that's something that would be worth the trade-off of it taking seconds to load. |
Thanks for both the quick response and the ample clarification. I made the change to I looked at commands like Those files may be worth looking at. I don't feel remotely confident in saying that the union of all of those files (together with /var/lib/dpkg/status) contains everything you'd need, but it might.
I was using fzf for the completions (adapting this function)—it's pleasant, but you're right about the trade-off. |
I did check those, unfortunately once you do that you end up being about as slow, and I suspect that we would have to redo some more of apt-cache's logic - a naive approach generates about twice the candidates that apt-cache does, presumably because the same package can appear in multiple repos (multiarch is a big thing here). We would have to find the right one if they aren't just direct duplicates. The database format itself appears to be not conducive to usable performance. |
Configuration
I'm running fish 3.6.0 on Debian bookworm. fish has been installed from the Debian package repository using apt. The behaviour is the same when running
Description
When I run
apt-get install <TAB>
, I'm given a list of possible packages to install.This isn't the full set of possible packages. This should be fairly obvious from the number, but it can be proven by filtering further
and then further
and seeing that the set has now expanded, not narrowed. (It's separately a little interesting that the set isn't refined.)
Does anyone know of any way to produce the full set of possible packages through tab-completion? I imagine I'm missing something fairly obvious but I couldn't find anything from searching around (both in the issues and outside of GitHub).
The text was updated successfully, but these errors were encountered: