Bug 1262742 - Docker fish completion not working
Docker fish completion not working
Product: Fedora
Classification: Fedora
Component: fish (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Andy Lutomirski
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-09-14 04:55 EDT by Yajo
Modified: 2015-09-30 13:57 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-09-30 13:57:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Yajo 2015-09-14 04:55:58 EDT
Description of problem:
The package docker-fish-completion does not provide any completions to the Docker CLI using Fish.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Install docker-fish-completion.
2. Open a fish terminal.
3. Write `docker rm [TAB]`.

Actual results:
Fish tries to complete with files in CWD.

Expected results:
Fish completes with containers in system, just as Bash.

Additional info:
You can check the same behavior in any docker sub-command (rmi, run, etc.). Same result.
Comment 1 Daniel Walsh 2015-09-14 08:44:19 EDT
Yajo, I have no idea how this works, and don't use fish.  Could you debug why it is not working or open an issue upstream?
Comment 2 Lokesh Mandvekar 2015-09-14 08:59:02 EDT
Yajo, is this a regression? or has it been this way all along? I'm not a fish user either, so patches are welcome :)
Comment 3 Lokesh Mandvekar 2015-09-14 09:00:45 EDT
just to note, I haven't changed anything in the docker rpms RE: fish.
Comment 4 Yajo 2015-09-15 04:42:36 EDT
This has worked at some point in the past, but long ago. I did not want to report it until Docker itself was working.

After debugging, it seems a bug in fish, but I don't know if in the packaging or in upstream.

According to http://fishshell.com/docs/current/index.html#completion-path, `/usr/share/fish/vendor_completions.d` should be a default search path, but `echo $fish_complete_path` returns this in an empty profile:

~/.config/fish/completions /etc/fish/completions /usr/share/fish/completions ~/.config/fish/generated_completions

After doing `set fish_complete_path $fish_complete_path /usr/share/fish/vendor_completions.d/`, Docker completions start to work. They have some bugs, but that's another story.

The same webpage says:

> Systems using the pkgconfig framework can discover this path from the output of pkg-config --variable completionsdir fish.

So trying that returns this:

Package fish was not found in the pkg-config search path.
Perhaps you should add the directory containing `fish.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fish' found
Comment 5 Daniel Walsh 2015-09-15 08:30:34 EDT
Please open bugzillas on docker fish completions, along with patches if possible.
Comment 6 Yajo 2015-09-16 03:14:00 EDT
(In reply to Daniel Walsh from comment #5)
> Please open bugzillas on docker fish completions, along with patches if
> possible.
> :^)

What do you mean? Upstream?

AFAIK docker-fish-completion is OK. The bug seems that Fish does not look into /usr/share/fish/vendor_completions.d by default, and it should.

I already changed the component to fish.
Comment 7 Daniel Walsh 2015-09-16 08:36:53 EDT
You said

After doing `set fish_complete_path $fish_complete_path /usr/share/fish/vendor_completions.d/`, Docker completions start to work. They have some bugs, but that's another story."

I interpreted the "They have some bugs" to refer to the Docker completions.
Comment 8 Yajo 2015-09-16 09:45:08 EDT
Ah ok. Yes indeed I found a bug there, but surely it's upstream's fault.

I'll start reporting there after this one is fixed.
Comment 9 Andy Lutomirski 2015-09-29 17:45:47 EDT
Can you confirm that this bug exists on an up-to-date fish package?  It works for me (modulo the bug that I'm about to file against docker).
Comment 10 Andy Lutomirski 2015-09-29 17:54:34 EDT
Never mind, no Docker bug either.  There's a bug with upstream docker's rpm package, but that's irrelevant.
Comment 11 Yajo 2015-09-30 03:34:14 EDT
With fish-2.2.0-3.fc22.x86_64 it seems fixed, thanks!

The upstream bug I refer is https://github.com/docker/docker/issues/16672, FTR.
Comment 12 Daniel Walsh 2015-09-30 10:31:53 EDT
Andy does the fedora docker package handle fish correctly?
Comment 13 Andy Lutomirski 2015-09-30 13:57:30 EDT
It seems to.  I'm going to close this, since it's not clear to me that there's any remaining bug.

Note You need to log in before you can comment on or make changes to this bug.