> this results in awkward viewing of short and empty results. Would it
> be possible to add a flag so that the pager is only used if the length
> of the output exceeds the height of the terminal?
No, because we'd have to know how many results there are before we
started sending any output.
xoxo,
Andy
--
Andy Lester => an...@petdance.com => www.theworkinggeek.com => AIM:petdance
> [snip] Would it
> be possible to add a flag so that the pager is only used if the length
> of the output exceeds the height of the terminal?
from man less:
-F or --quit-if-one-screen
Causes less to automatically exit if the entire file can
be displayed on the first screen.
> No, because we'd have to know how many results there are before we
> started sending any output.
So, we can already specify pager options. How 'bout an inline way to
toggle the pager on and off? We might also need a new env variable.
E.g.,
$ export ACK_USE_PAGER=false # the default
$ ack # do NOT use the pager
$ ack -p # use the pager defined by ACK_PAGER
$ export ACK_USE_PAGER=true
$ ack # use the pager
$ ack -p # use the pager
I don't know if this is a good idea or not, but I can't imagine
another way to solve this.
r
> I don't know if this is a good idea or not, but I can't imagine
> another way to solve this.
There's a --nopager option already.
I don't know if this is a good idea or not, but I can't imagine
another way to solve this.
> Andy, I could have sworn that "less -FRX" was ack's default pager at
> one point. Am I imagining things?
I don't think it ever was. I'm not much of a pager fan anyway.
xoa
> I was just using the pager as recommended by the help file. Maybe we
> should change the recommended pager in the help from less -R to less -
> FRX?
Patches welcome. It's all in github. (I guess then it should really
be "fork pull requests welcome")