Open fpopineau opened 7 years ago
Using the default (defcustom counsel-ag-base-command "ag --nocolor --nogroup %s")
works fine on Linux. With that setting, the cmd called would be:
ag --nocolor --nogroup HANDLE
Also, can you open a PR with the patch? It's not easy to see what you changed.
What version of ag is that ? Mine from msys2/mingw64 is waiting on standard input with:
ag --nocolor --nogroup HANDLE
I need to specify a directory in order to make it look for something, hence my proposed addition of default-directory to the command arguments. Version reported is:
$ ag --version
ag version 0.31.0
Features:
+jit +lzma +zlib
I will add the PR.
What version of ag is that ?
I have ag version 0.19.2
on Linux.
So I have checked the behaviour of ag under Linux and under msys2/mingw64. The result is that ag is affected like other msys2/mingw64 programs by some weirdness of console detection. Namely, under msys2/mingw64, the following command:
ag --nocolor --nogroup HANDLE
is waiting for input on stdin, whereas it reads files from the current directory under Linux.
I may say the fact that the file/directory is optional on ag
command line maybe handy when you type the command on the terminal, but it is also harmless to explicitly state this parameter. It also makes it clearer what directory is used for the search. In other words, my patch is harmless for Linux and fixes the behaviour for Windows.
Please open a PR with the patch.
Changing the definition in Counsel.el
did not fix counsel-ag
but it did fix my problem with spacemacs/search-project-auto
that I described in #852
I'm new to ivy/swifer/counsel, but wanted to give it a try. I'm running Emacs-25.1 under Windows. I tried `counsel-ag' but got no results. Then I traced the command which counsel is running and I found something like this:
But with no file/directory on the line. Is that expected? Because to get results, I had to apply this patch: