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:
@@ -114,6 +114,12 @@ OpenSSH command to remotely execute mosh-server on remote machine (default: "ssh
|
||||
|
||||
An alternate ssh port can be specified with, \fIe.g.\fP, \-\-ssh="ssh \-p 2222".
|
||||
|
||||
.TP
|
||||
.B \-\-ssh-pty\fP
|
||||
.B \-\-no-ssh-pty\fP
|
||||
Enable or disable ssh's use of a pty when connecting to a remote host.
|
||||
The default is enabled.
|
||||
|
||||
.TP
|
||||
.B \-\-predict=\fIWHEN\fP
|
||||
Controls use of speculative local echo. WHEN defaults to `adaptive'
|
||||
|
||||
+9
-1
@@ -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' ) {
|
||||
|
||||
@@ -388,8 +388,6 @@ static int run_server( const char *desired_ip, const char *desired_port,
|
||||
if ( ioctl( STDIN_FILENO, TIOCGWINSZ, &window_size ) < 0 ||
|
||||
window_size.ws_col == 0 ||
|
||||
window_size.ws_row == 0 ) {
|
||||
fprintf( stderr, "Server started without pseudo-terminal. Opening 80x24 terminal.\n" );
|
||||
|
||||
/* Fill in sensible defaults. */
|
||||
/* They will be overwritten by client on first connection. */
|
||||
memset( &window_size, 0, sizeof( window_size ) );
|
||||
|
||||
Reference in New Issue
Block a user