Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

damil commented Dec 15, 2009

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]


blixtor commented Dec 30, 2009

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

lloeki commented Apr 11, 2012

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 beyondgrep/ack2 Aug 28, 2013


ack erroneously goes into filter mode #346


hoelzro commented Aug 28, 2013

Addressed in petdance/ack2#346.

@hoelzro hoelzro closed this Aug 28, 2013

@n1vux n1vux referenced this issue in beyondgrep/ack3 Sep 17, 2017


sane headless operation #103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment