Re: [HACKERS] use of pager on Windows psql

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] use of pager on Windows psql
Date: 2008-05-18 13:49:45
Message-ID: 200805181349.m4IDnjO00591@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan wrote:
> >>>> 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.
> >>>>
> >>>>
> >>> Yes, we could do that but does the isatty() value ever change while psql
> >>> is running? When you do '\g filename' does stdout then have isatty as
> >>> false?
> >>>
> >>>
> >> Good point. I think the best thing would just be to remove the #ifndef
> >> WIN32 / #endif lines
> >>
> >
> > OK, patch applied to remove the Win32 test in both places.
> >
> >
> >
>
> This broke the buildfarm and finally explains the following kluge which
> has been puzzling me for four years:
>
> /*
> * for some reason MinGW (and MSVC) outputs an extra newline, so
> this
> * suppresses it
> */
> #ifndef WIN32
> fputc('\n', fout);
> #endif
>
> I have removed the kluge (and yes, I tested it).

Oh, that kluge. Why did the isatty() addition fix this? Was the pager
being used on Win32 for the regression tests and somehow eating a line
or something?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2008-05-18 14:06:17 Re: [HACKERS] use of pager on Windows psql
Previous Message Merlin Moncure 2008-05-18 13:33:27 Re: libpq object hooks (libpq events)

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2008-05-18 14:06:17 Re: [HACKERS] use of pager on Windows psql
Previous Message Merlin Moncure 2008-05-18 13:33:27 Re: libpq object hooks (libpq events)