Skip to content
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

Generated fish completion does not complete filenames #372

Closed
sboukortt opened this issue Oct 21, 2018 · 16 comments · Fixed by #391 or #482
Closed

Generated fish completion does not complete filenames #372

sboukortt opened this issue Oct 21, 2018 · 16 comments · Fixed by #391 or #482
Labels
good first issue Good for newcomers packaging/tooling upstream-error A bug in an upstream component

Comments

@sboukortt
Copy link

The result is that Tab is only able to complete options, and not the paths to the files that one may want to display.

@sharkdp
Copy link
Owner

sharkdp commented Oct 21, 2018

Thank you for reporting this.

I think this is related to clap-rs/clap#568

I guess we have the same problem with other shell completion files.

@sharkdp sharkdp added help wanted Extra attention is needed upstream-error A bug in an upstream component labels Oct 21, 2018
@ghost
Copy link

ghost commented Oct 29, 2018

Personally I scarcely use bat options, or at least I use options way less frequently than filenames, so I much prefer to complete filenames instead of options.

Could you disable these completions until the upstream error is fixed?

@sharkdp
Copy link
Owner

sharkdp commented Oct 29, 2018

@swiesner-dlr I agree. Sounds like a good idea to me. We should enable the shell completions for the next release.

@sharkdp sharkdp added good first issue Good for newcomers and removed help wanted Extra attention is needed labels Oct 29, 2018
sharkdp added a commit that referenced this issue Oct 31, 2018
sharkdp added a commit that referenced this issue Oct 31, 2018
@sharkdp
Copy link
Owner

sharkdp commented Nov 11, 2018

Shell completions are not included in the new release bat 0.9.

@ErinCall
Copy link

I'm still having this issue—I get tab-completion for options, but not for filenames. I'm using bat 0.9.0 (newly installed via homebrew) and I'm using fish 3.0.0 (recently upgraded from 2.7.1 in case an outdated fish version was the problem). I haven't tried building from source; is that worth an attempt?

@sharkdp
Copy link
Owner

sharkdp commented Jan 17, 2019

Can you please search your filesystem for any remaining fd.fish autocompletion files?

It seems like the brew formula still ships the completion files: https://github.com/Homebrew/homebrew-core/blob/5df9397fb96b3e74b7aca993afa2b620e0db9d44/Formula/bat.rb

I'm afraid this would have to be reported in the homebrew-core repository.

@ErinCall
Copy link

ErinCall commented Jan 17, 2019

Thanks! I removed /usr/local/Cellar/bat/0.9.0_1/share/fish/vendor_completions.d/bat.fish and now it's working as expected :)

Edit: I put it back and removed the /usr/local/share/fish/vendor_completions.d/bash.fish symlink instead

@fxcoudert
Copy link

Shell completions are not included in the new release bat 0.9

I believe this is incorrect. The completion files are still built during cargo install, they are produced by build.rs. If they weren't built, Homebrew wouldn't be able to install them :)

@sharkdp
Copy link
Owner

sharkdp commented Jan 19, 2019

Yes - sorry. I just removed them from the tarballs and the Debian packages. If that is needed, we can disable building these files all together. If you think that is required, please open a new ticket.

@maraisr
Copy link

maraisr commented Jan 25, 2019

How long would it take for homebrew to pick up the new changes? Ie, at 1807 25/01/2019 I ran a brew install bat and am seeing the bat.fish completion files.

@sharkdp sharkdp reopened this Jan 25, 2019
worldofpeace added a commit to NixOS/nixpkgs that referenced this issue Jan 25, 2019
Currently having the shell completions makes it
impossible to complete filenames.

Upstream Issue: sharkdp/bat#372
@sharkdp
Copy link
Owner

sharkdp commented Jan 26, 2019

I have now completely disabled the generation of the files, so for the next release package maintainers will be "forced" to remove them from the packages.

@alexbepple
Copy link

alexbepple commented Jan 27, 2019

If, somehow, you still have the old completions, you can also just add

complete -c bat -a '(__fish_complete_path)'

to your config and have it all. ;)

Maybe, there is a simple way to add this to the generated completions, so you can re-enable them, @sharkdp?

danbst pushed a commit to danbst/nixpkgs that referenced this issue Jan 31, 2019
Currently having the shell completions makes it
impossible to complete filenames.

Upstream Issue: sharkdp/bat#372
@jonas-schievink
Copy link

@alexbepple Oooh, thanks for this, very handy!

@sharkdp I'm sure you've thought of this already, but another workaround would be to stop using a subcommand and instead:

  • Turn cache into normal arguments that use dashes, like bat --init-cache, bat --clear-cache, ...
  • Add another small CLI tool just for managing the cache, like bat-cache --init, ...

Personally I wouldn't expect a tool like bat to take a subcommand at all, since it always gets a file argument anyways, and that could collide with the subcommand and cause confusion.

@sharkdp
Copy link
Owner

sharkdp commented Feb 7, 2019

@sharkdp I'm sure you've thought of this already, but another workaround would be to stop using a subcommand and instead:

The cache subcommand is not the problem here. The argument parser clap, which we use, does not support the generation of proper shell completion files even if there would be no subcommand (see my first comment in this issue).

@sharkdp
Copy link
Owner

sharkdp commented Feb 8, 2019

No shell completion files should be shipped with v0.10.0.

alexbepple added a commit to alexbepple/fish-config that referenced this issue Feb 10, 2019
@axelson
Copy link

axelson commented Mar 20, 2019

For anyone watching this 0.10.0 is now out on homebrew and completion now works great! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers packaging/tooling upstream-error A bug in an upstream component
Projects
None yet
8 participants