use of pager on Windows psql - Mailing list pgsql-hackers

From Andrew Dunstan
Subject use of pager on Windows psql
Date
Msg-id 482F43E0.6000003@dunslane.net
Whole thread Raw
Responses Re: use of pager on Windows psql  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: WIP: Pg_upgrade - page layout converter (PLC) hook
Next
From: Tom Lane
Date:
Subject: Link requirements creep