-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
bat.fish: There should be only one #651
Comments
This might need to be discussed a bit. There's a few things that need to be taken into consideration here. In regards to how the completions are distributed, I think having them distributed in the bat packages would definitely be ideal. This would allow for them to be relevant to user's installed version of bat rather than set in stone until the next fish release. My only lingering concern with this method is how it should be handled when bat and fish have different install prefixes (e.g. if bat is installed to I also think that incorporating your completions into the one provided by bat would be a great idea, but there's a couple things that I feel should be discussed: Which sort order for the option completions would be the best one to use? Each of them have their own advantages. Alphabetical is ordered in a straightforward way, while ordering it in the same way as Although the @sharkdp, your thoughts? |
I think the current
I say it should be omitted from the completions because nobody who's typing out |
I made an explicit choice to not sort the 👍 for removing |
I totally agree that it's fine with letting the packaging people figure it out themselves, since they know their own ecosystems better than we would. I would also like to be able to have the official GitHub release packages to work properly in the majority of cases as well, though. Should we research this and see if it's possible to create post-install scripts to detect and symlink the completions if the prefix is different than what fish is installed to? Or would that be bad practice? I would be happy to move forward on merging the completions regardless, but if it's something that you guys think is worth pursuing, I can open a new issue on it and we can tackle it later down the line.
Seeing as how @sharkdp was already going for the "most useful first" order within
Very good point. It would probably be fairly annoying and unhelpful to have a useless option show up as an actual suggestion when you're trying to find the one you want. I'm all for removing it, then. |
When #673 is merged, we should combine @adiabatic's completions with the ones in this repo. I've also spent some time thinking of how to package the completions. Ideally, package maintainers would add the fish completions to the relevant vendor-completions path for fish and everything would just work. But, we can't exactly guarantee that is always going to be the case. How about we have two copies of the fish completions? Fish can provide its own copy (possibly outdated, but better than nothing), and we can provide a vendor copy on top of that. Based on my testing with fish 3.0.2, it has a sane load order that works perfectly for this:
If there are multiple completion files, it will only read the higher priority one. No mixed/overridden completions. |
That's good to hear. When I read about complete --erase I guessed that completions in all the different places would be added together with some sort of per-completion last-completion-standing battle royale. Happy to be wrong about that. |
Just a quick note that this is not on my radar. Happy to merge changes that resolve this, though. |
This seems to be related i guess. I am on Linux Mint (Ubuntu bionic). I installed the bat deb file manually using |
Related discussion: fish-shell/fish-shell#5822 (comment) , where a fish dev suggests that 3rd-parties should package their completions in |
Just ran into the same problem as @dl1ely. Is there any way to fix this in the meantime? I can't install the |
@jswny I got it force-installed using |
@dl1ely Thanks, that worked! |
I'd expect an influx of users over time that experience this problem. I just experienced this problem myself. If you are a fish user, you are also often "cool enough" to use awesome tools such as bat and ripgrep. Both now fails to install under the latest fish shell. ripgrep already pushed a fixed for this (see BurntSushi/ripgrep@bb49e6f#diff-80398c5faae3c069e4e6aa2ed11b28c0R104) but it has not been released yet. I think this breaking bat installation for fish shell users warrants bat to do a patch version upgrade with a fix. The fix itself is simple to implement, but I am unsure about bat's release process. |
Don't force install; Debian gives you the right tool for the job with
I'll get fish 3.1.1 out the door soon, which will also fix the problem. |
@zanchey Perhaps i did something wrong, i tried the |
If you have used force-install, you probably have to remove bat, fish-common, and fish, and reinstall them all. |
Happy to release a new version once this is fixed. |
This has been fixed in bat 0.13. |
A while back, during 0.11.x, I thought
bat
didn't have anyfish
completion file, so I wrote one. When 0.12.0 came out, I updated the fish completion file to support the freshly-added-L
option. This file is in thefish
repository, and will be released to the public whenever the fish maintainers get around to releasing a new version (in all likelihood, not too soon).Today, when watching 0.12.1 come in via Homebrew, I noticed that Homebrew installed a
bat
completion of its own into/usr/local/share/fish/vendor_completions.d
. Seems like I've been scooped.I figure that the completion in the
fish
repo should be deleted in favor of the one provided withbat
itself. I think the one I wrote has a number of improvements over the one that's bundled withbat
:bat cache
options, not justbuild
andclear
.There are also a couple other differences that I feel I should point out:
--help
text. Thebat.fish
that ships withbat
sorts everything by-l
value (long option).__bat_complete_languages_and_extensions
assumes that one can specify a language by typing out its fancy name and not just an extension. (Maybe this assumption is wrong.)-u
/--unbuffered
, since it's just a POSIX-compliance thing that gets ignored bybat
anyway.Would
bat
be better if the completion currently sitting in thefish
repository were incorporated into thebat
distribution? Regardless of whether the answer is "yes" or "no", I ought to remove the one in thefish
repository.The text was updated successfully, but these errors were encountered: