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
Ack hangs when used in conjunction with ssh in a single line command #259
Comments
After reading a couple of other reports that mention nofilter I think I have a better handle on what is going on. Ack only ignores STDIN when it detects a TTY. Most command line programs use the presence of a TTY for being interactive or not. Ack does not use the presence of file arguments as a trigger as to whether to ignore STDIN or not. Grep ignore STDIN whenever it has file arguments. Ack developers have wanted to support using both a file argument and STDIN at the same time and refer to reading from STDIN as "filtering". The A proposal was made to remove the Based on this analysis, there is another workaround which is to have SSH fake a tty:
None of the workarounds are compelling to me because they involve obscure command line flags that need to be memorized. |
Also reading from both STDIN and a file doesn't appear to work. If you use That can be tested locally using the following command and then pressing
|
I've thought about that, too. Note that there have been problems with expectations of ack's handling of stdin since the dawn of time. I'm almost tempted to have to make the user have to explicitly pass a flag to use ack as a filter on stdin. |
Indeed, you can't read from both STDIN and a regular file. |
I'm seriously considering removing the implicit "figure out if ack is being a filter" or not. See the ticket referenced just above in the ack3 queue. |
🔗 |
this calls `vgrep` on all 3 major CE repos (`CE:`, `archer-boot:`, and `cheops:` this requied some ancillary changes to `vgrep`: - fix for `ack` not working when called via `ssh` -- (cf beyondgrep/ack3#259) - simplify the paging code - only spit out the spacing lines if printing to a terminal - try to return a proper error code -- this isn't working yet
ack
hangs when used as an argument tossh host
:Hangs until you press ctrl-c. Normal grep does not suffer from this problem:
A workaround appears to be to use the
--nofilter
argument. It isn't clear to me exactly what it does, but I tried it because I thought that ack might be waiting for STDIN and the man page mentioned that ack treats STDIN differently with the flag:Reported against
The text was updated successfully, but these errors were encountered: