Fix to TestDriver.pm (qtest)

This commit is contained in:
Jay Berkenbilt 2020-10-16 14:12:37 -04:00
parent 18b34a5649
commit 1019ed5758
1 changed files with 11 additions and 1 deletions

View File

@ -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)