Peter Eisentraut wrote: I asked the folks over at "Experts Exchange" to test the behavior of the ioctl and $COLUMNS on various platforms. I'd been told that I would face huge problems if a console was resized. But the results were pretty consistent, and nothing had problems with resize: http://www.experts-exchange.com/Programming/Open_Source/Q_23243646.htmlBruce 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). It appears impossible to override $COLUMNS, on some platforms as the readline call sets it. On many platforms $COLUMNS is null until the call to readline. OSX does not set $COLUMNS at all. -Bryce |
- Re: [PATCHES] Proposed patch - psql wraps at window width Bruce Momjian
- Re: [PATCHES] Proposed patch - psql wraps at window ... Bryce Nesbitt
- Re: [PATCHES] Proposed patch - psql wraps at win... Bruce Momjian
- Re: [PATCHES] Proposed patch - psql wraps at... Bryce Nesbitt
- Re: [PATCHES] Proposed patch - psql wraps at window ... Alvaro Herrera
- Re: [PATCHES] Proposed patch - psql wraps at window ... Peter Eisentraut
- Re: [PATCHES] Proposed patch - psql wraps at win... Gregory Stark
- Re: [PATCHES] Proposed patch - psql wraps at... Tom Lane
- Re: [PATCHES] Proposed patch - psql wrap... Gregory Stark
- Re: [PATCHES] Proposed patch - psql wrap... Bryce Nesbitt
- Re: [PATCHES] Proposed patch - psql wraps at win... Bryce Nesbitt
- Re: [PATCHES] Proposed patch - psql wraps at... Tom Lane
- Re: [PATCHES] Proposed patch - psql wrap... Gregory Stark
- Re: [PATCHES] Proposed patch - psql wraps at win... Bryce Nesbitt
- Re: [PATCHES] Proposed patch - psql wraps at win... Bryce Nesbitt
- Re: [PATCHES] Proposed patch - psql wraps at... Gregory Stark
- Re: [PATCHES] Proposed patch - psql wrap... Joshua D. Drake
- Re: [PATCHES] Proposed patch - psql wraps at window width Alvaro Herrera
- Re: [PATCHES] Proposed patch - psql wraps at window ... Bruce Momjian
- Re: [PATCHES] Proposed patch - psql wraps at win... Alvaro Herrera
- Re: [PATCHES] Proposed patch - psql wraps at... Bruce Momjian