Re: Proposed patch - psql wraps at window width

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, <pgsql-patches(at)postgresql(dot)org>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "Bryce Nesbitt" <bryce2(at)obviously(dot)com>, <heikki(at)enterprisedb(dot)com>
Subject: Re: Proposed patch - psql wraps at window width
Date: 2008-04-18 03:35:41
Message-ID: 871w53bzsi.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Gregory Stark <stark(at)enterprisedb(dot)com> writes:
>> Also, how would you suggest figuring the width to use for output going to a
>> file? ioctl is irrelevant in that case, imho it should just default to 80
>> columns if COLUMNS is unset.
>
> It would be a spectacularly awful idea for this patch to affect the
> output to a file at all.

It's a compromise of convenience over principle to allow the default output
format to vary but I would still want to have the same set of output formats
_available_ to me regardless of whether I'm redirecting to a file or not. Much
like ls -C is available even if you're redirecting to a file and -1 is
available if you're on a terminal.

It sucks to run a program, decide you want to capture that output and find you
get something else. It *really* sucks to find there's just no way to get the
same output short of heroic efforts.

I also have the converse problem occasionally. I run everything under emacs
and occasionally run into programs which default to awkward output formats.
Usually it's not too bad because it's still on a pty but the window width is a
particular one which confuses programs.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's RemoteDBA services!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-04-18 03:41:41 Re: Lessons from commit fest
Previous Message Greg Smith 2008-04-18 03:34:41 Re: Lessons from commit fest

Browse pgsql-patches by date

  From Date Subject
Next Message Bryce Nesbitt 2008-04-18 03:55:52 Re: Proposed patch - psql wraps at window width
Previous Message Tom Lane 2008-04-18 00:49:22 Re: Proposed patch - psql wraps at window width