Dup to pty to prevent ssh from reading our stdin

Dup the pty to STDIN to prevent hour the exec'ed ssh from consuming our
early input.
Due to the fact that mosh-server copies the pty settings from the pty it
as when starting, we can't set that one to a raw.

This are probably a combination of effects cased by fcc629ac and
18dc967c.

This probably fixes #366

[Closes #369]
This commit is contained in:
Anton Lundin
2013-01-08 18:08:13 +01:00
committed by Keith Winstein
parent 2dcef54e24
commit 2ef025c09a
+1 -1
View File
@@ -222,9 +222,9 @@ my $pid = fork;
die "$0: fork: $!\n" unless ( defined $pid ); die "$0: fork: $!\n" unless ( defined $pid );
if ( $pid == 0 ) { # child if ( $pid == 0 ) { # child
$pty->close_slave(); $pty->close_slave();
$pty->set_raw();
open STDOUT, ">&", $pty or die; open STDOUT, ">&", $pty or die;
open STDERR, ">&", $pty or die; open STDERR, ">&", $pty or die;
open STDIN, "<&", $pty or die;
my @server = ( 'new', '-s' ); my @server = ( 'new', '-s' );