diff --git a/scripts/mosh b/scripts/mosh index d1baaee..ceb641e 100755 --- a/scripts/mosh +++ b/scripts/mosh @@ -178,7 +178,8 @@ if ( $pid == 0 ) { # child } if ( scalar @command > 0 ) { - push @server, ( '--', @command ); + my $command_string = q{"} . (join ' ', @command) . q{"}; + push @server, ( '--', '/bin/sh', '-c', $command_string ); } exec 'ssh', '-S', 'none', '-o', "ProxyCommand=$0 --fake-proxy -- %h %p", '-t', $userhost, '--', @server;