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

Re: wrap long lines



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday, August 29 at 10:36 AM, quoth Gary Johnson:
> On my Linux box with the default-for-here ksh:
>
>    $ trap 'echo SIGWINCH' SIGWINCH
>    sh: trap: bad signal SIGWINCH

Mmmm, some versions of ksh require traps to be labelled somewhat 
differently. This should work:

    trap 'echo SIGWINCH' WINCH

If all else fails, you can look up the signal number like so:

    grep SIGWINCH /usr/include/*/*.h

On my systems, it's signal 28, so this would work:

    trap 'echo SIGWINCH' 28

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

;) From the bash man page:

    COLUMNS
           Used by the select builtin command to determine the 
           terminal width when printing selection lists. Automatically 
           set upon receipt of a SIGWINCH.

> On my SunOS box:
>
>    $ trap 'echo SIGWINCH' SIGWINCH
>
> but I don't see anything when I resize the xterm window.

What shell? What version?

Check out the man page---there may be trap-related weirdnesses. When I 
tried it on a SunOS box, it printed SIGWINCH after every line.

> On my HP-UX box:
>
>    $ trap 'echo SIGWINCH' SIGWINCH
>    $
>    SIGWINCH
>
>    SIGWINCH
>    $
>
> but I get only one "SIGWINCH" for every roughly 12 window resizings.

Weird.

> So I guess the answer is to run bash everywhere.

Some would say that "bash" stands for "Bad-Ass SHell" rather than 
"Bourne Again SHell"

;)

Sorry - had to get the shell advocacy in there. :D

~Kyle
- -- 
Liberty means responsibility. That is why most men dread it.
                                                -- George Bernard Shaw
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFE9Iq7BkIOoMqOI14RAq7gAJ4xkaKXvgf3wPPYh33f/98ghQruzQCcCwno
+bV7J9Ddmz6Tz8UyPC9t1CI=
=5hxo
-----END PGP SIGNATURE-----