X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FUtils.pm;h=5ee745106b37cce7d21878d81dc8023f4d63460f;hp=78c293a6ca6c935350bff3a051a32bb3fc5b0394;hb=ad9e8de94e240b8668b084ec2714deead7921a98;hpb=d5765d73f6a77f0c6f88fe634cec77dcb95c00c6 diff --git a/lib/Catalyst/Utils.pm b/lib/Catalyst/Utils.pm index 78c293a..5ee7451 100644 --- a/lib/Catalyst/Utils.pm +++ b/lib/Catalyst/Utils.pm @@ -384,11 +384,21 @@ that 'env' now lists COLUMNS.) As last resort, default value of 80 chars will be used. +Calling C with a true value will cause it to be recalculated; you +can use this to cause it to get recalculated when your terminal is resized like +this + + $SIG{WINCH} = sub { Catalyst::Utils::term_width(1) }; + =cut my $_term_width; sub term_width { + my $force_reset = shift; + + undef $_term_width if $force_reset; + return $_term_width if $_term_width; my $width;