Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Reverse the direction of the IO::Pty used for ssh.

May address #114.
May address #164.
  • Loading branch information...
commit fe8e50de2bc101989b0ce78f8942b9b5ea89346b 1 parent bcb96d9
Jay Freeman (saurik) authored April 16, 2012 keithw committed April 16, 2012

Showing 1 changed file with 4 additions and 5 deletions. Show diff stats Hide diff stats

  1. 9  scripts/mosh
9  scripts/mosh
@@ -192,10 +192,10 @@ if ( (not defined $colors)
192 192
 my $pid = fork;
193 193
 die "$0: fork: $!\n" unless ( defined $pid );
194 194
 if ( $pid == 0 ) { # child
  195
+  $pty->close_slave();
  196
+  open STDOUT, ">&", $pty or die;
  197
+  open STDERR, ">&", $pty or die;
195 198
   close $pty;
196  
-  open STDOUT, ">&", $pty_slave->fileno() or die;
197  
-  open STDERR, ">&", $pty_slave->fileno() or die;
198  
-  close $pty_slave;
199 199
 
200 200
   my @server = ( 'new', '-s' );
201 201
 
@@ -218,8 +218,7 @@ if ( $pid == 0 ) { # child
218 218
   die "Cannot exec ssh: $!\n";
219 219
 } else { # server
220 220
   my ( $ip, $port, $key );
221  
-  $pty->close_slave();
222  
-  LINE: while ( <$pty> ) {
  221
+  LINE: while ( <$pty_slave> ) {
223 222
     chomp;
224 223
     if ( m{^MOSH IP } ) {
225 224
       ( $ip ) = m{^MOSH IP (\S+)\s*$} or die "Bad MOSH IP string: $_\n";

0 notes on commit fe8e50d

Please sign in to comment.
Something went wrong with that request. Please try again.