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

counsel-ag + ivy-occur bash error #1240

Closed
SkySkimmer opened this Issue Oct 16, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@SkySkimmer

SkySkimmer commented Oct 16, 2017

Reproduction:

  • counsel-ag
  • search for a _b (regardless of presence of matches) (in general string - space - string starting with underscore)
  • ivy-occur

Result: occur buffer containing

-*- mode:grep; default-directory: "[redacted]" -*-


2 candidates:
.//bin/bash: -c: line 0: syntax error near unexpected token `('
.//bin/bash: -c: line 0: `ag --nocolor --nogroup (a).*?(_b)'

This doesn't seem to happen with counsel-grep.

@abo-abo abo-abo closed this in 1107875 Oct 16, 2017

@abo-abo

This comment has been minimized.

Owner

abo-abo commented Oct 16, 2017

Thanks.

@SkySkimmer

This comment has been minimized.

SkySkimmer commented Oct 16, 2017

There are still quoting issues, with " for ag and ' for grep. Maybe use shell-quote-argument like counsel-grep does to pass the filename?

abo-abo added a commit that referenced this issue Oct 16, 2017

counsel.el: shell-quote-argument clean-up
* counsel.el (counsel-grep-like-occur): Update.
(counsel-rg-base-command):
(counsel-grep-base-command): Add warning not to use single quotes.
(counsel-grep-function): Update.
(counsel-grep-occur): Update.

Fixes #1240
@abo-abo

This comment has been minimized.

Owner

abo-abo commented Oct 16, 2017

Thanks again. Please test, again.

@SkySkimmer

This comment has been minimized.

SkySkimmer commented Oct 16, 2017

Seems to work. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment