-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Corinna Vinschen on 7/28/2008 9:27 AM: |> # check the window size after each command and, if necessary, |> # update the values of LINES and COLUMNS. |> shopt -s checkwinsize |> |> would it work in cygwin? Also; | | Looks like bash on Cygwin doesn't set LINES and COLUMNS. Eric?
Hmm. Right now, bash _does_ set LINES and COLUMNS (as shell variables, you have to export them for children to see), but only after the first SIGWINCH, or if you have 'shopt -s checkwinsize', after the first non-builtin-command (ie. if checkwinsize is set, bash does not check window size after builtins - how weird is that?). At any rate, I already have a cygwin-specific patch for the upstream bug that lib/sh/winsize.c forgot to include <termios.h>. And blindly setting checkwinsize seems like it would slow things down: since SIGWINCH works (I tested in both cmd and urxvt), there is no need to slow down bash to check window size after every single command, when only window size changes are necessary. checkwinsize is primarily for those platforms that lack SIGWINCH. At any rate, you've given me an idea. Add this to /etc/profile, and $LINES and $COLUMNS will be automatically populated for all users, regardless of whether they use 'shopt -s checkwinsize': kill -s WINCH $$ - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkiPAOsACgkQ84KuGfSFAYB4+wCgnKRhiE1P6r/mKrOeR0BabG2n LjsAnR6CQyVTjw6huQBbHXU8qn4GvNyX =yxl6 -----END PGP SIGNATURE-----