I've read, for instance here, that one could just run M-x grep
to interface with the underlying shell and just run a simple grep
command. I suspect something is wrong in the setup because this simple command does not work. Here's what I can see:
The command I type after M-x grep
is
grep 'Cell' input.scs
It can be seen in the above screenshot right above the (garbled) shell
prompt.
I don't know if that's a sign but it looks like the codes used to format the shell prompt are not totally understood by the *grep*
buffer, but besides that, the process seems to stay in the "compiling" state forever, never returning any hit.
On the other hand, the very same command grep 'Cell' input.scs
(you can see above the prompt) does work fine in a shell
inside the directory this file is in.
Running emacs -nw input.scs
returns basically the same output. Here I have used the command:
grep -A1 'Cell' input.scs
If I run emacs -Q input.scs
to avoid loading of init.el
, I still get the same result:
What can be possibly going wrong there?
M-x grep
. And say whatgrep
you're using. And say whether you're using Emacs in terminal mode. Do you see this when you start Emacs usingemacs -Q
(no init file)? If not, bisect your init file to find the culprit. If yes, normally (with most greps) it just works out of the box, and even if you try to grep binary files grep just tells you that a file is binary - it doesn't vomit terminal escape chars or binary data. – Drew Feb 14 '23 at 02:40grep
command to work, and that has nothing to do with Dired. Please edit to just ask about yourM-x grep
problem. – Drew Feb 14 '23 at 02:42ansi-color-apply-on-region
, which is not an interactive command or other relatedansi-color-*
functions. – Arktik Mar 16 '23 at 16:09