Re: Use of pager, help, localization:

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Use of pager, help, localization:
Date: 2018-10-15 19:52:42
Message-ID: 17075.1539633162@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com> writes:
> From psql/help.c
> /*
> * Keep this line count in sync with the number of lines printed below!
> * Use "psql --help=variables | wc" to count correctly; but notice that
> * Windows builds currently print one more line than non-Windows builds.
> * Using the larger number is fine.
> */
> output = PageOutput(156, pager ? &(pset.popt.topt) : NULL);

> uhm... this doesn't work at all with i10n, above all if respecting an
> 80 cols width.
> Wouldn't be better to generate the output in a temp buffer after l10n,
> count the line, then choose whether to use a pager or not?

Don't think it's really worth the trouble, because this ends up being
just a binary decision (use pager or no). Supposing that the true
line count post-localization is, say, 165 --- it would only matter if
the vertical height of your terminal window is between 156 and 164 lines.
And even if it is, the worst-case effect is that a couple of lines would
scroll off the top and you'd have to scroll down to get them back.

If this number were more critical, we'd have come up with some technology
to get it more correct; but in practice I think anything much over 100
is probably a don't-care for most people.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2018-10-15 19:55:19 Re: pg11rc1 DROP INDEX: NOTICE: drop_trigger
Previous Message Tom Lane 2018-10-15 19:44:52 Re: pg11rc1 DROP INDEX: NOTICE: drop_trigger