-
-
Notifications
You must be signed in to change notification settings - Fork 338
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-grep shows no results on OS X #2190
Comments
Looks like you need to set up your PATH. Use Also check: (executable-find "grep")
;; => "/bin/grep" |
Hey Oleh. Thanks for responding. I don't think it is a path issue. I got here by trying to migrate from helm; helm search commands: grep, ag, rg etc work as expected. Also here is what executable-find reports:
Also, |
How about |
Yes it does. Running |
OK, so the path to git is not the problem. I don't have access to OSX. But I assume other OSX users don't have this problem, so it's likely a config issue. What's your |
In the test case above, ie, from
|
Ok, nice. After I
and re-execute the test above, In this case I have:
|
OK, so now we have a workaround. Let's investigate it further. Please try to grep with your default zsh setup. Then post here the value of |
Ok, here is the command that gets executed
Running that in eshell does give a hint that my environment may be an issue; which may be related to how the shell is executed. However, when I first cd to the appropriate directory, the grep runs fine eshell output
results of grep in the counsel dir: buffer *grep*
|
You should not run it in eshell. |
M-x shell resultsOk, running grep from
outside emacs from zshHere is the exact output I get from zsh. NB, my zsh config emits the git branch (
outside emacs from bashThe bash prompt is also multi line.
colorizedBoth shell prompts presume a color-capable terminal; ie they are both colorized. I'm not sure if that is relevant to this exploration or not. |
Can you grep for something, confirm there's no result (although there should be). Then eval |
Going meta: should we consider non POSIX compliant shell commands as bugs? |
@mookid If Emacs built-ins like |
The reason would be to avoid issues with users that prefer some shell that is not the default one. |
I ran the process again from the top starting from It took a very long time (30 seconds?) to eval results of
|
Ok, my hypothesis is confirmed: it appears to have to do with my zsh login scripts. To validate this, I created a new user on MacOS: |
Thanks for following through. I've created a new wiki entry, based on this issue: https://github.com/abo-abo/swiper/wiki/Troubleshooting. Feel free to edit, the wiki is open. I think the issue is solved now, closing. |
If it is true that this is solely an interaction between my zsh login scripts and emacs, then it should be possible to recreate the issue without counsel being involved at all. So I spent some time attempting just that: to recreate the issue independent of counsel. My first line of inquiry was trying to evaluate how long it was taking to startup zsh outside of emacs. My rough measurements show that zsh, both as a login shell and not, show it starts up in about 1 second. Which should be just fine. So second, I thought I would try to reproduce the issue in emacs without counsel involved. So starting from
I see consistent times of less than 1 second, as reported by the
Again, to isolate as much as possible, I have started this from From your perspective, does this test result raise any questions about the conclusion that this issue is simply an interaction with my zsh login scripts? |
I should note also that I have been doing most of this investigation while on the train, and I know that my network connection quality while on the train varies greatly. So if my fairly complex zsh init scripts try to perform network operations, that could add to the delay. And maybe the measurements I just did were under favorable network conditions? |
Ok, so I ran another experiment to measure the impact of invoking zsh as a login shell via
I do see longer start up times, but all of these commands complete in < 2 seconds as shown by the
|
Having a shell with a startup time of 2 seconds is not acceptable for Try to configure Emacs so that your |
Ok, this problem is fully resolved and Thanks for all of your help! Super cool. |
Summary
It appears to me that the
counsel
functions that invoke external processes do not reliably report theresults of those process invocations on Mac OS X. This behavior is shown on a minimally configured emacs via
emacs -Q
. The reproducible sequence does not show the bug behavior on 3 tested ubuntu-based releases of emacs.Issues Searching with counsel
I seem to be having issues searching with
counsel
. Specifically, runningcounsel-grep
gathers theinputs, but generates no results: no results buffer. I see the same behavior with other counsel file
searching functions as well.
Steps to Reproduce
emacs -Q
M-x eval-buffer
on thisM-x counsel-grep
M-x
runscounsel-M-x
counsel
which should result in many matches in the filecounsel.el
Versions of Emacs Tested
Shows the bug
GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511)) of 2018-05-30
/Applications/Emacs.app/Contents/MacOS/Emacs -Q
GNU Emacs 26.2 (build 1, x86_64-apple-darwin18.5.0) of 2019-04-13
/usr/local/Cellar/emacs/26.2/bin/emacs-26.2 -Q
Works as Expected
The text was updated successfully, but these errors were encountered: