diff --git a/scripts/mosh.pl b/scripts/mosh.pl index 41c31b0..7cf69e1 100755 --- a/scripts/mosh.pl +++ b/scripts/mosh.pl @@ -219,11 +219,14 @@ if ( defined $fake_proxy ) { defined( my $pid = fork ) or die "$0: fork: $!\n"; if ( $pid == 0 ) { + close STDIN; cat $sock, \*STDOUT; $sock->shutdown( 0 ); _exit 0; } $SIG{ 'HUP' } = 'IGNORE'; + close STDOUT; cat \*STDIN, $sock; $sock->shutdown( 1 ); + close STDIN; waitpid $pid, 0; exit; }