<<< Date Index >>>     <<< Thread Index >>>

Re: wrap long lines



On 2006-08-28, Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx> wrote:
> On Monday, August 28 at 03:31 PM, quoth Gary Johnson:
> > (Hmm.  I wonder if, as a user, you can trap SIGWINCH in a shell.)
> 
> Of course. In bash, the following works:
> 
>     trap 'echo SIGWINCH!' SIGWINCH

On my Linux box with the default-for-here ksh:

    $ trap 'echo SIGWINCH' SIGWINCH
    sh: trap: bad signal SIGWINCH

On my Linux box after starting bash:

    bash-2.05b$ trap 'echo SIGWINCH' SIGWINCH
    bash-2.05b$ SIGWINCH
    bash-2.05b$ SIGWINCH
    bash-2.05b$ SIGWINCH

Nice!  Further, bash appears to update the values of LINES and 
COLUMNS after resizes by itself, so the user trap isn't even 
necessary.

On my SunOS box:

    $ trap 'echo SIGWINCH' SIGWINCH

but I don't see anything when I resize the xterm window.

On my HP-UX box:

    $ trap 'echo SIGWINCH' SIGWINCH
    $
    SIGWINCH

    SIGWINCH
    $

but I get only one "SIGWINCH" for every roughly 12 window resizings.

So I guess the answer is to run bash everywhere.

Regards,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA