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

No zsh filename tab-autocompletion #532

Closed
mattsmithdatera opened this issue Jun 29, 2017 · 5 comments
Closed

No zsh filename tab-autocompletion #532

mattsmithdatera opened this issue Jun 29, 2017 · 5 comments
Labels
help wanted Others are encouraged to work on this issue. question An issue that is lacking clarity on one or more points.

Comments

@mattsmithdatera
Copy link

Info:

rg --version
ripgrep 0.5.2

zsh --version
zsh 5.2 (x86_64-apple-darwin15.0.0)

Reproduction steps:

  1. Use zsh shell
  2. Copy _rg autocompletion file to zsh /usr/share/zsh/site-functions location
  3. type `rg "test-match" /usr/
  4. Start pressing tab.
  5. Nothing is suggested

Expected behavior (demonstrated with bash shell, where this functions correctly):

  1. Use bash shell
  2. copy rg bash autocompletion file to /usr/local/etc/bash_completion.d
  3. type rg "test-match" /usr/
  4. Start pressing tab
  5. Files in /usr/ are suggested for autocompletion

Additional info:

  • Zsh autocompletes ripgrep options without issue
  • Zsh fails to autocomplete files regardless of presence of zsh autocompletion file in site-functions folder
  • ripgrep installed via Homebrew on OSX
@BurntSushi
Copy link
Owner

Someone else will need to handle this.

@BurntSushi BurntSushi added help wanted Others are encouraged to work on this issue. question An issue that is lacking clarity on one or more points. labels Jun 29, 2017
@BurntSushi
Copy link
Owner

(I'm really not happy about ripgrep providing auto completions like this. I don't have the inclination to debug their problems.)

@okdana
Copy link
Contributor

okdana commented Jul 1, 2017

The zsh completion function in the Homebrew package is not the one that's in the ripgrep repository. Not sure where theirs comes from, there's no attribution or anything. The one in the repo seems to work fine for me, at least in terms of completing the file name. There are some other (trivial) issues with it, though, that i can put together a PR for if you want. (The biggest one is that the descriptions for --count and --max-count are the same, which causes zsh to treat them as aliases for each other.)

ETA: Oh, their completion function must be the one that clap was auto-generating. It wasn't replaced by the hand-written one until a few weeks after 0.5.2 was released. Homebrew will probably pull in the new one whenever 0.5.3 lands.

@BurntSushi
Copy link
Owner

@okdana PRs would be most appreciated. :-)

@BurntSushi
Copy link
Owner

BurntSushi commented Jul 3, 2017

It sounds like this has been fixed, but you need to use the manually curated zsh completion script here: https://github.com/BurntSushi/ripgrep/blob/master/complete/_rg (Which should be the one that is bundled in the next release tarball.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Others are encouraged to work on this issue. question An issue that is lacking clarity on one or more points.
Projects
None yet
Development

No branches or pull requests

3 participants