Browse files

wvtest: Don't try to set pty window size of not run on a real tty

  • Loading branch information...
1 parent 948f6c6 commit 5c42d99960a3610eb9c9f1b2529be8cc073ec19d @wentasah wentasah committed May 25, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 michal/wvtest/wvnulrun
View
5 michal/wvtest/wvnulrun
@@ -27,6 +27,7 @@ use IO::Pty;
# always flush
$| = 1;
+my $istty = -t STDOUT && $ENV{'TERM'} ne "dumb";
my $pty = new IO::Pty;
my $pid = fork();
@@ -37,7 +38,7 @@ if (!$pid) {
# setpgrp(); # Terminal won't send signals to the child
my $slave = $pty->slave();
close $pty;
- $slave->clone_winsize_from(\*STDIN);
+ $slave->clone_winsize_from(\*STDIN) if $istty;
$slave->set_raw();
open(STDIN,"<&". $slave->fileno())
@@ -62,7 +63,7 @@ sub winch {
$SIG{WINCH} = \&winch;
}
-$SIG{WINCH} = \&winch;
+$SIG{WINCH} = \&winch if $istty;
sub bigkill($)
{

0 comments on commit 5c42d99

Please sign in to comment.