Skip Navigation

Slow Nala completions - Janky hack m8

github.com GitHub - volitank/nala: a wrapper for the apt package manager.

a wrapper for the apt package manager. Contribute to volitank/nala development by creating an account on GitHub.

GitHub - volitank/nala: a wrapper for the apt package manager.

I've been using nala on my debian-based computers instead of apt, mostly for the parallel downloads, but also because the UI is nicer. I have one issue, and that's the slow completions; it's not wasting painful amounts of time, but it still takes a second or two each time I hit tab. I don't know if this is the same for all shells, but I'm using zsh.

I tried a workaround, but it seems prone to breaking something. So far it's working fine for my purposes, so I thought I'd share anyway:

  1. I backed up /usr/share/zsh/vendor-completions/_nala to my home directory
  2. I copied /usr/share/zsh/functions/Completion/Debian/_apt to /usr/share/zsh/vendor-completions/_nala
  3. I used vim to %s/apt/nala/g (replace every instance of 'apt' to 'nala') in the new /usr/share/zsh/vendor-completions/_nala

Already that's sped up the completions to seemingly as fast as any other command. And already I can see some jank peaking through: zsh now thinks nala has access to apt commands that it definitely doesn't (e.g. nala build-dep, nala changelog and nala full-upgrade), and it has lost autocompletions for nala fetch and nala history.

Once I understand completions files syntax better, I'll fix it to only use the commands listed in nala's manpage and submit a pr to the git repo. In the meantime, if anyone has suggestions for how to correct the existing completions file or more ways to make the _apt completions fit nala, it'd be much appreciated.

0
0 comments