Re: Proposed patch - psql wraps at window width

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Proposed patch - psql wraps at window width
Дата
Msg-id 87prrzu8sa.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Proposed patch - psql wraps at window width  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Proposed patch - psql wraps at window width  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
"Bruce Momjian" <bruce@momjian.us> writes:

> FYI, I looked into 'ls -C' hanlding a little more and ls (GNU coreutils)
> 5.97 honors COLUMNS _only_ in file/pipe output, not for screen output. 
> What the C code does is to read COLUMNS, then overwrite that value with
> ioctl() if it works.

Well saying "file/pipe" and "screen output" is making a lot of assumptions.
The pipe may still be ending up on the screen if it's being piped to a pager.
And a "file" could still be a terminal. Also, not all terminals support the
ioctl().

What ls does is use the same logic for all cases. When the ioctl works that
takes precedence regardless of whether it's "file/pipe" or "screen output".
When it fails it uses COLUMNS instead if set.

We really must stop thinking in terms of specific use cases. You will tie
yourselves in knots if you try to enumerate all the types of terminals, places
people redirect output, and uses people might make for the output. And it will
result in very complex, hard to explain behaviour which will surprise and
disappoint users.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's 24x7 Postgres support!


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Meskes
Дата:
Сообщение: Re: ecpg localization
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Query Hints? No thanks. Data hints?