use of pager on Windows psql

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: use of pager on Windows psql
Date: 2008-05-17 20:45:20
Message-ID: 482F43E0.6000003@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


psql's print.c contains this piece of code:

/*
* PageOutput
*
* Tests if pager is needed and returns appropriate FILE pointer.
*/
FILE *
PageOutput(int lines, unsigned short int pager)
{
/* check whether we need / can / are supposed to use pager */
if (pager
#ifndef WIN32
&&
isatty(fileno(stdin)) &&
isatty(fileno(stdout))
#endif
)
{

Why are we not doing the isatty tests on Windows? We can and do use
isatty on Windows elsewhere, so I'm a bit mystified about this.

In fact, it looks to me like it would be much more sensible to #include
"settings.h" and then simply test pset.notty for all platforms.

cheers

andrew

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-05-17 21:40:13 Link requirements creep
Previous Message Zdenek Kotala 2008-05-17 20:40:59 Re: WIP: Pg_upgrade - page layout converter (PLC) hook

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2008-05-17 21:27:42 Re: [COMMITTERS] pgsql: Don't call rm with empty file list.
Previous Message daveg 2008-05-17 20:32:05 pg_dump lock timeout - resend