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

Bat autocomplete with zsh is buggy #495

Closed
alichtman opened this issue Feb 4, 2019 · 2 comments
Closed

Bat autocomplete with zsh is buggy #495

alichtman opened this issue Feb 4, 2019 · 2 comments
Labels
duplicate This issue or pull request already exists question Further information is requested

Comments

@alichtman
Copy link

alichtman commented Feb 4, 2019

Whenever I enter $ bat <TAB> to prompt zsh autocompletion, it autocompletes cache instead of cycling through available files in the directory, like zsh does for other programs.

Typing $ bat <First Letters> results in zsh saying no completions can be found.

I've confirmed that cat does not exhibit this behavior, and none of the other tools I've installed with brew do this either.

Here's the result of $ cat <TAB> <TAB> <TAB>.

image

Here's $ bat <TAB> <TAB> <TAB>

image

The issue here is that bat prefers tabbing into the options over tabbing into the files it can print out.

OS: macOS Mojave 10.14.1
Installed through HomeBrew
Shell: zsh 5.7 (x86_64-apple-darwin18.2.0)

➜ brew info bat                                                                                                                               📦 v1.1.7 with ⬢ v11.9.0 at 7:15AM 
bat: stable 0.9.0 (bottled)
Clone of cat(1) with syntax highlighting and Git integration
https://github.com/sharkdp/bat
/usr/local/Cellar/bat/0.9.0_1 (9 files, 5.5MB) *
  Poured from bottle on 2019-02-03 at 09:38:19
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/bat.rb
==> Dependencies
Build: rust ✘
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Analytics
install: 11,582 (30 days), 26,041 (90 days), 74,443 (365 days)
install_on_request: 11,553 (30 days), 25,986 (90 days), 74,335 (365 days)
build_error: 0 (30 days)
@alichtman alichtman changed the title Bat autocomplete with zsh no longer works Bat autocomplete with zsh is buggy Feb 4, 2019
@alichtman
Copy link
Author

I upgraded to zsh 5.7.2 from 5.7.1 and can't replicate the $ bat <TAB> <TAB> <TAB> example from above. So maybe it's a zsh issue and not a bat issue?

I've just run into another issue which stops me from bat-ting multiple files at a time with autocomplete.

$ bat <Tab to autocomplete first file> <Tab>

The second tab always fills in cache for me.

Another issue I discovered is that when you autocomplete cache, the next thing autocompleted is cache, a second time. Only after that second cache will zsh give me the option to scroll through options.

image

Upon selection, the command is invalid.

image

@sharkdp
Copy link
Owner

sharkdp commented Feb 4, 2019

This looks like a duplicate of #372 and should be "fixed" in the next release (by not providing a shell completion file).

@sharkdp sharkdp added duplicate This issue or pull request already exists question Further information is requested labels Feb 4, 2019
@sharkdp sharkdp closed this as completed Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants