Re: Proposed patch - psql wraps at window width

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Aidan Van Dyk <aidan(at)highrise(dot)ca>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gregory Stark <stark(at)enterprisedb(dot)com>, Brendan Jurd <direvus(at)gmail(dot)com>, Bryce Nesbitt <bryce2(at)obviously(dot)com>, heikki(at)enterprisedb(dot)com
Subject: Re: Proposed patch - psql wraps at window width
Date: 2008-04-24 20:32:17
Message-ID: 200804242032.m3OKWHd21443@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut wrote:
> Bruce Momjian wrote:
> > Greg's suggestion is to use $COLUMNS if the width can't be determined
> > because the output is not directly to the screen. ?$COLUMNS is updated
> > by many shells.
>
> I think it is best not to look at $COLUMNS at all. If the output is to a
> terminal, then use ioctl to query the terminal. And provide a \pset command
> to set a width explicitly, which can apply in all cases.

Yes, that is pretty much what we have now, except we try for $COLUMNS if
ioctl() fails for interactive use.

--
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 Bruce Momjian 2008-04-24 20:36:38 Re: Proposed patch - psql wraps at window width
Previous Message Bruce Momjian 2008-04-24 20:29:16 pgsql: Update: < * Allow adding enumerated values to an existing

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2008-04-24 20:37:22 Re: Proposed patch - psql wraps at window width
Previous Message Peter Eisentraut 2008-04-24 20:23:22 Re: Proposed patch - psql wraps at window width