bash-completion not working on core18-base classic snap

Bug #1802721 reported by Alberto Donato
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Released
Medium
Unassigned

Bug Description

On my "sshoot" snap (sudo snap install sshoot --edge --classic), tab-completion with bash is currently not working.

I've followed steps on https://forum.snapcraft.io/t/debugging-tab-completion/4198 to debug, and I get no failure at any of the steps.

In step 4, when I run the complete command I get the following:

$ snap run --command=complete sshoot 9 9 7 1 " " 'sshoot ' sshoot ""
default

<output ends here>

instead of getting possible completions.

If I run commands in step 5 and manually load completion from a shell in the snap, it works.

note that "core" needs to be installed in addition to "core18" before installing this snap because of https://github.com/snapcore/core18/issues/89

Revision history for this message
John Lenton (chipaca) wrote :

So, you're hitting two or three separate bugs. The extra one is if you try this on snapd and hit the ld-so absolute symlink one :)

Getting no completion if core isn't installed is fixed by https://github.com/snapcore/snapd/pull/6126

which you know can be worked around by ... installing core :-)

Getting no completion with core installed is fixed by
https://github.com/snapcore/snapd/pull/6129

we've gone over how to work around the second one on IRC, but it's: tweak your completion script to not have the function depend on $1 (I'd recommend you not call python to generate the completion script every time it's invoked, in any case).

Changed in snapd:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → John Lenton (chipaca)
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

John, what is the status of this issue?

 * There is https://github.com/snapcore/core18/issues/89 which is currently open
 * The two pull requests referenced above are both merged
   * https://github.com/snapcore/snapd/pull/6126
   * https://github.com/snapcore/snapd/pull/6129
 * A casual examination of a core18 system shows that we don't have completion at all
   bash -<tab,tab> doesn't expand like it does on core16

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

/me realises the issue talks about core18-based classically confined snap. Not strictly about a snap that runs on core18.

Zygmunt Krynicki (zyga)
Changed in snapd:
status: In Progress → Confirmed
assignee: John Lenton (chipaca) → nobody
Revision history for this message
Ratchanan Srirattanamet (peat-new) wrote :

This problem seems to also happen on strictly-confined snap (lxd). And I guess I've found the issue.

https://github.com/snapcore/snapd/blob/4405f25a553d31876bfe5346948b9b8f0e2b67d4/data/completion/bash/complete.sh#L117

This line seems to hardcode the name of "core" snap in it.

Revision history for this message
Ian Johnson (anonymouse67) wrote :

I can not reproduce the issue for either lxd or sshoot on my Groovy desktop, I get tab completion results for both snaps. Can folks confirm if this is still an issue for them and specify what system (`snap version`) and what snaps you have installed (`snap list`) if you can reproduce the issue?

Changed in snapd:
status: Confirmed → Incomplete
Revision history for this message
Alberto Donato (ack) wrote :

It's working for me as well (on both snaps) on Groovy.

Revision history for this message
Ian Johnson (anonymouse67) wrote :

Thanks for confirmation. We still have the known issue about completion not working on Ubuntu Core 18, but I think this bug is resolved for classic Ubuntu installs with bash.

Changed in snapd:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.