test-terminal: set output terminals to raw mode

Not setting them to raw mode causes funny things to happen, such as
\n -> \r\n translation:

  ./test-terminal.perl echo foo | xxd
  0000000: 666f 6f0d 0a                             foo..

(Notice the added 0d.)

To avoid this, set the (pseudo)terminal to raw mode.  Note that the
IO::Pty docs recommend doing it on both master and slave.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Thomas Rast 2011-12-12 19:09:14 +01:00 committed by Junio C Hamano
parent 0510480510
commit a463aefa35

View file

@ -69,6 +69,10 @@ sub copy_stdio {
}
my $master_out = new IO::Pty;
my $master_err = new IO::Pty;
$master_out->set_raw();
$master_err->set_raw();
$master_out->slave->set_raw();
$master_err->slave->set_raw();
my $pid = start_child(\@ARGV, $master_out->slave, $master_err->slave);
close $master_out->slave;
close $master_err->slave;