Ack in shell mode in Emacs for Windows does not show output

After installing ack on a 64-bit version of Windows 7 (for example, using StrawberryPerl ), I can run ack from the cmd terminal on Windows.

However, if I try to use ack in Emacs in Shell mode (i.e. in the Mx shell buffer), I do not get output (all other cmd commands print correctly though).

Interestingly, if I run only ack , that is, without arguments, I get the correct information about using ack . In other words, ack does not output the result in my Emacs shell when I run it with arguments (even if ack should print hits for my queries, as I checked in the CMD section).

The lack of output makes me think that ack is waiting for input (although I provide it with arguments). I tried the code snippet suggested here in my .emacs file (which seems to have been designed to help when it gets confused between searching on the file system or STDIN), but the problem still persists.

Any suggestions on how to fix this?

thanks

+4
source share
2 answers

ack waits on stdin, incorrectly thinking that it is in filter mode. As a workaround, add <NUL to the end of the command, closing it with stdin.

FYI - running "ack" in the perl debugger, inside the emacs shell on Windows, shows that it stops here:

 main::print_matches_in_resource(c:/Strawberry/perl/site/bin/ack:454): 454: while ( <$fh> ) { 
+2
source

Did you tag ack.el ?

What I use on Windows 7. This makes using ack easier. By default, a word search in a point is suggested. And you get the result through compilation, so you can easily jump to the file and line containing the match.

+1
source

Source: https://habr.com/ru/post/1333414/


All Articles