Skip to content
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

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

Closed
damil opened this issue Dec 15, 2009 · 4 comments
Closed

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

damil opened this issue Dec 15, 2009 · 4 comments

Comments

@damil
Copy link

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
Copy link
Contributor

blixtor commented Dec 30, 2009

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

@lloeki
Copy link

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]
pty.spawn(argv)

@jkline-okta
Copy link

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
Copy link
Collaborator

hoelzro commented Aug 28, 2013

Addressed in beyondgrep/ack2#346.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants