diff options
author | John Hood <cgull@glup.org> | 2014-05-17 01:34:14 -0400 |
---|---|---|
committer | John Hood <cgull@glup.org> | 2016-09-19 13:23:15 -0400 |
commit | 70d48fbcc038d4f746bab029e8449812263f2cf9 (patch) | |
tree | d848f487c9e0b30417de338f9bd923504b31ce6b /scripts | |
parent | 8945efeb82aad2919f47f9848374190dbc626d63 (diff) |
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.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/mosh.pl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/mosh.pl b/scripts/mosh.pl index 45d5c4c..37eb1ff 100755 --- a/scripts/mosh.pl +++ b/scripts/mosh.pl @@ -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' ) { |