Add --no-ssh-pty option.

This eliminates issues with typeahead being echoed by the remote pty
and corrupting remote output from mosh-server to the mosh script, but
cannot be made default because older mosh-servers require a pty.
This commit is contained in:
John Hood
2014-05-17 01:34:14 -04:00
parent 8945efeb82
commit 70d48fbcc0
3 changed files with 15 additions and 3 deletions
+9 -1
View File
@@ -72,6 +72,8 @@ my $term_init = 1;
my $localhost = undef;
my $ssh_pty = 1;
my $help = undef;
my $version = undef;
@@ -104,6 +106,8 @@ qq{Usage: $0 [options] [--] [user@]host [command...]
(example: "ssh -p 2222")
(default: "ssh")
--no-ssh-pty do not allocate a pseudo tty on ssh connection
--no-init do not send terminal initialization string
--local run mosh-server locally without using ssh
@@ -147,6 +151,7 @@ GetOptions( 'client=s' => \$client,
'6' => sub { $family = 'inet6' },
'p=s' => \$port_request,
'ssh=s' => sub { @ssh = shellwords($_[1]); },
'ssh-pty!' => \$ssh_pty,
'init!' => \$term_init,
'local' => \$localhost,
'help' => \$help,
@@ -328,7 +333,10 @@ die "$0: fork: $!\n" unless ( defined $pid );
if ( $pid == 0 ) { # child
open(STDERR, ">&STDOUT") or die;
my @sshopts = ( '-n', '-tt' );
my @sshopts = ( '-n' );
if ($ssh_pty) {
push @sshopts, '-tt';
}
my $ssh_connection = "";
if ( $use_remote_ip eq 'remote' ) {