On 01May2016 21:23, Chris Angelico <ros...@gmail.com> wrote:
On Sun, May 1, 2016 at 8:55 PM, Steven D'Aprano <st...@pearwood.info> wrote:
Is there an environment variable to tell the application what you
consider "short", or should it read your mind?
How about $LINES? If it's less than that, it'll fit on one screen. Of
course, that still won't be perfect, but it's a definite improvement
over guessing.
On terminal emulators you can normally query the terminal directly for its
current size (look at the output of "stty -a" for example), and pagers do. This
is better than $LINES, which is really a convenience thing presented by some
shells like bash and which won't magicly change if you resize your terminal
until bash gets another look.
If your pager can be told to autoquit if the output fits then this pain point
(whatever your preference) can be largely obviated.
Cheers,
Cameron Simpson <c...@zip.com.au>
--
https://mail.python.org/mailman/listinfo/python-list