Comment 10 for bug 1590767

Revision history for this message
Stéphane Graber (stgraber) wrote :

So I just gave this a try using snapcraft 2.33 and snapd 2.26.10 and couldn't get it to work...

As far as I can tell, the snapd package doesn't actually integrate complete.sh with the system's bash-completion mechanism.

To get it called, I've hat to create a symlink at /usr/share/bash-completion/completions/lxc pointing to /usr/lib/snapd/complete.sh

This did make something happen, in that now "lxc <tab>" hangs for a bit, doesn't complete anything, then pressing enter doesn't even run the command. Sometimes pressing enter a second time gets it to execute it, anyway, short is that things aren't working the way they should.

Attempting to track down the problem further, I found out that the following was passed to "snap run":

    snap run --command=complete lxc 63 9 8 1 "'><=;|&(: lxc lxc

Running this manually, gives me:

error: cannot find current revision for snap lxc: readlink /snap/lxc/current: no such file or directory

Which makes sense given that the snap is "lxd" and "lxc" is an alias for "lxd.lxc".

Attempting to get things to work with "lxd.lxc" rather than "lxc" also didn't go so well, possibly because the completion script inside the snap assumes "lxc".

Anyway, it appears that we need:
 - Actually integrate complete.sh with the system's bash-completion
 - Get the completion handling to work properly with aliases

Or maybe I missed something obvious somewhere and it's just my snap that's broken somehow :)