wrong guess about filter mode when running inside Emacs (or Vim) #106

damil opened this Issue Dec 15, 2009 · 4 comments


None yet

5 participants


ack 1.92 decides to go into filter mode when (-p STDIN) is true. Filter mode means that input is taken from stdin and not from files given on the command line. But when running inside Emacs, the condition is true because it's an inferior process, and then nothing happens because Emacs doesn't pipe anything into ack STDIN.
So in such a case we don't want the filter behaviour, and therefore we need a way to forcefully disable filter mode from a command line option.
[problem occured with Emacs 22.3.1 on win32, running ack.el version 0.4]


would be solved with issue 90's --[no]filter option


Can't believe this is not fixed yet, and that flags like -G get dropped when specified.
Same problem with Gedit external tools.

Workaround: wrap ack in a (python) script that creates a pseudo-terminal on stdin (may not work on non-linux).

#!/usr/bin/env python
import sys, pty
search = sys.stdin.read().strip()
argv = ['ack', search]

I get this same error when running ack remotely with sudo:
$ ssh ahost.sleepycat.com -- sudo ack pattern file
ack: Ignoring 1 argument on the command-line while acting as a filter.

Problems occurs with ahost running versions:
$ ssh ahost.sleepycat.com -- sudo ack --version
ack 1.96
Running under Perl 5.10.1 at /usr/bin/perl

but does not occur when running the same remote command against a different server with ack 1.96 Running under Perl 5.8.8.

@hoelzro hoelzro referenced this issue in petdance/ack2 Aug 28, 2013

ack erroneously goes into filter mode #346


Addressed in petdance/ack2#346.

@hoelzro hoelzro closed this Aug 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment