Re: Proposed patch - psql wraps at window width

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Proposed patch - psql wraps at window width
Дата
Msg-id 87bq48at8t.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Proposed patch - psql wraps at window width  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Proposed patch - psql wraps at window width
Список pgsql-patches
"Peter Eisentraut" <peter_e@gmx.net> writes:

> Bruce Momjian wrote:
>> I checked the use of COLUMNS and it seems bash updates the environment
>> variable when a window is resized.  I added ioctl(TIOCGWINSZ) if COLUMNS
>> isn't set.  We already had a call in print.c for detecting the
>> number of rows on the screen to determine if the pager should
>> be used.  Seems COLUMNS should take precedence over ioctl(), right?
>
> Considering that the code to determine the row count is undisputed so far, the
> column count detection should work the same.  That is, we might not need to
> look at COLUMNS at all.  Unless there is a use case for overriding the column
> count (instead of just turning off the wrapping).

I do that all the time. I normally am running under an emacs terminal so I
don't know what width the ioctl's going to get back but it's unlikely to be
right. In any case I may want to format the output to a width narrower than
the window because I'm going to narrow it.

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.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's Slony Replication support!

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: datum passed to macro which expects a pointer
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Proposed patch - psql wraps at window width