diff options
| -rw-r--r-- | challenge-032/simon-proctor/perl6/ch-2.p6 | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/challenge-032/simon-proctor/perl6/ch-2.p6 b/challenge-032/simon-proctor/perl6/ch-2.p6 index 6e497adf27..0022fd7e2b 100644 --- a/challenge-032/simon-proctor/perl6/ch-2.p6 +++ b/challenge-032/simon-proctor/perl6/ch-2.p6 @@ -66,7 +66,12 @@ sub get-bar( Int $available, $max, $value ) { } sub get-screen-width() { - run("tput","cols",:out).out.slurp.chomp; + my $result; + try { + $result = run("tput","cols",:out).out.slurp.chomp; + } + # Fallback incase tput not available + return $result || 100; } sub parse-space-sep( Str $line ) { |
