[wellylug] Man-page formatting

Grant McLean grant at mclean.net.nz
Thu Jun 30 22:35:57 NZST 2005


On Thu, 2005-06-30 at 22:24 +1200, Ewen McNeill wrote:
> In message <1120124243.4408.14.camel at localhost>, Grant McLean writes:
> >When you're running bash and you resize the window, bash gets a signal
> >and updates $COLUMNS, but ... [...]
> >If you're in another program in the text window such as man/less/vi, the
> >foreground program gets the window change signal and bash doesn't, so
> >when you get back to the shell, the value of $COLUMNS won't match the
> >window size.
> 
> Interesting theory, but it doesn't seem to be the case here (Debian
> Woody, XFree86 4.3 backport, xterm):
> 
> -= cut here -=-
> ewen at basilica:~ $ echo $COLUMNS
> 80
> ewen at basilica:~ $ less /etc/passwd
> [.... resize window while less is running, then quit ....]
> ewen at basilica:~ $ echo $COLUMNS
> 73

I've definitely confirmed that exactly the symptoms I described occur on
both woody and sarge.  In fact I tested it before sending my message.
My explanation is speculation though.

I have noticed that it seems to make a difference whether less is
reading from a file or a pipe that's blocked.

The common scenario I run into is piping something into less, adjusting
the terminal size and then exiting less to find bash's line-wrapping is
messed up.

I'd also note that I'm using gnome-terminal.

Cheers
Grant




More information about the wellylug mailing list