ack --flush --pager='less -R -F -X' waits

13 views
Skip to first unread message

Simon Shine

unread,
May 1, 2018, 9:25:38 AM5/1/18
to ack users
Hello ack-users,

I've recently tweaked my ack to the point of:

    ack --flush --pager='less -R -F -X'

This is neat because the pager only becomes interactive if the results are too large to fit one screen.

But unfortunately less waits with printing things to screen before it can determine that the results are, in fact, too large to fit one screen. So when there are many files and few results, it doesn't print those few results as soon as it sees them.

I realize that this is a) not a problem with the way I use ack, but rather with the way I use less, and b) a principal problem, since if less printed lines until it realized there were too many of them, and then performed termcap init and printed everything again for the interactive mode, that might not be desired in any average case.

Has anyone encountered this delay and found a neat way to overcome it?

(Basically, I'd love to overcome the whole "ack ...; ah, shoot, too many results; ack ... --pager=..." situation that I've been used to with grep for decades.)

Perhaps I'm looking for a smarter pager than less.

Kindly,
Simon Shine

Bill Ricker

unread,
May 1, 2018, 8:58:55 PM5/1/18
to ack-...@googlegroups.com
On Tue, May 1, 2018 at 7:02 AM, Simon Shine <shredd...@gmail.com> wrote:
Hello ack-users,

I've recently tweaked my ack to the point of:

    ack --flush --pager='less -R -F -X'

This is neat because the pager only becomes interactive if the results are too large to fit one screen.

​Interesting! ​

 
​... ​
Perhaps I'm looking for a smarter pager than less.

​If you find it, let us know and I'll insert it into the Ack 3 cookbook page ​!
(Less is still better than more.)



--
Reply all
Reply to author
Forward
0 new messages