Re: Proposed patch - psql wraps at window width

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Bryce Nesbitt <bryce2(at)obviously(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Brendan Jurd <direvus(at)gmail(dot)com>, heikki(at)enterprisedb(dot)com
Subject: Re: Proposed patch - psql wraps at window width
Date: 2008-05-06 00:42:17
Message-ID: 200805060042.m460gHq15652@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
> Gregory Stark wrote:
> > "Bruce Momjian" <bruce(at)momjian(dot)us> writes:
> >
> > > OK, so COLUMNS should take precedence. I assume this is going to
> > > require us to read the COLUMNS enviroment variable in psql _before_
> > > readline sets it, and that COLUMNS will only affect screen output, like
> > > ioctl(). Is that consistent?
> >
> > What are you talking about? "screen output"?
> >
> > Are you even getting my emails? Please confirm that you receive this email.
>
> Yes, I am getting your emails, but I have more than you to please.
>
> Are others OK with $COLUMNS controlling screen output and file/pipe, or
> perhaps COLUMNS controlling only file/pipe, as GNU ls does? I have
> heard a few people say they only want \pset columns to control
> file/pipe.
>
> I have outlined the GNU ls behavior in a email I just sent.

I talked to Greg on IM and he had a new idea, related to my 'auto' idea
of using aligned/wrapped/expanded mode automatically.

His idea is that 'auto' mode (aligned/wrapped/expanded) is only for
output to the screen, and 'wrapped' is always wrapped. 'Wrapped' would
be affected by \pset columns, COLUMNS, or the terminal width for output
to screen, file, or pipe. If no width could be derrmined for wrapped,
it would default to 72.

This gives us 'wrapped' that always wraps (if it can fit the headings),
and most people will use 'auto' in their psqlrc, and it affects only
terminal output.

--
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

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-05-06 01:12:06 Re: Proposed patch - psql wraps at window width
Previous Message Bruce Momjian 2008-05-05 23:56:13 Re: Proposed patch - psql wraps at window width