make sure we still properly decode the part name
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Utils.pm
index 78c293a..1bccecb 100644 (file)
@@ -10,7 +10,6 @@ use Cwd;
 use Class::Load 'is_class_loaded';
 use String::RewritePrefix;
 use Class::Load ();
-
 use namespace::clean;
 
 =head1 NAME
@@ -384,11 +383,21 @@ that 'env' now lists COLUMNS.)
 
 As last resort, default value of 80 chars will be used.
 
+Calling C<term_width> 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;
@@ -493,6 +502,8 @@ sub apply_registered_middleware {
     return $new_psgi;
 }
 
+
+
 =head1 PSGI Helpers
 
 Utility functions to make it easier to work with PSGI applications under Catalyst