Skip to content

Commit a463aef

Browse files
trastgitster
authored andcommitted
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 <[email protected]> Acked-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0510480 commit a463aef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

t/test-terminal.perl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ sub copy_stdio {
6969
}
7070
my $master_out = new IO::Pty;
7171
my $master_err = new IO::Pty;
72+
$master_out->set_raw();
73+
$master_err->set_raw();
74+
$master_out->slave->set_raw();
75+
$master_err->slave->set_raw();
7276
my $pid = start_child(\@ARGV, $master_out->slave, $master_err->slave);
7377
close $master_out->slave;
7478
close $master_err->slave;

0 commit comments

Comments
 (0)