diff options
author | Jay Berkenbilt <ejb@ql.org> | 2020-10-16 20:12:37 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2020-10-16 23:15:39 +0200 |
commit | 1019ed5758d97da4a3376da3af1f38a7b99dc93f (patch) | |
tree | 9b59cac2e0b6ccf3f323eeb4bca591002caf5e83 /qtest/module | |
parent | 18b34a564906c7ef36daefab081b44ebfd9ee64b (diff) | |
download | qpdf-1019ed5758d97da4a3376da3af1f38a7b99dc93f.tar.zst |
Fix to TestDriver.pm (qtest)
Diffstat (limited to 'qtest/module')
-rw-r--r-- | qtest/module/TestDriver.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/qtest/module/TestDriver.pm b/qtest/module/TestDriver.pm index 704ad12c..a320a1af 100644 --- a/qtest/module/TestDriver.pm +++ b/qtest/module/TestDriver.pm @@ -118,7 +118,13 @@ sub get_tty_features eval { require Term::ReadKey; - ($ncols, undef, undef, undef) = Term::ReadKey::GetTerminalSize(); + if (-t STDOUT) + { + # This prints error messages if STDOUT is not a tty, so + # check even if -stdout-tty=1 was given. + ($ncols, undef, undef, undef) = + Term::ReadKey::GetTerminalSize(\*STDOUT); + } $got_size = 1; }; if (! $got_size) @@ -145,6 +151,10 @@ sub get_tty_features } }; } + if (! defined $ncols) + { + $ncols = 80; + } eval { if ($in_windows) |