Fix excess newlines on mosh startup/shutdown.
Fixes #788. This also works around issues with remote pty typeahead echo corrupting output from mosh-server.
This commit is contained in:
@@ -192,7 +192,7 @@ int main( int argc, char *argv[] )
|
||||
success = false;
|
||||
}
|
||||
|
||||
printf( "\n[mosh is exiting.]\n" );
|
||||
printf( "[mosh is exiting.]\n" );
|
||||
|
||||
free( key );
|
||||
|
||||
|
||||
@@ -406,7 +406,15 @@ static int run_server( const char *desired_ip, const char *desired_port,
|
||||
network->set_verbose();
|
||||
}
|
||||
|
||||
printf( "\nMOSH CONNECT %s %s\n", network->port().c_str(), network->get_key().c_str() );
|
||||
/*
|
||||
* If mosh-server is run on a pty, then typeahead may echo and break mosh.pl's
|
||||
* detection of the MOSH CONNECT message. Print it on a new line to bodge
|
||||
* around that.
|
||||
*/
|
||||
if ( isatty( STDIN_FILENO ) ) {
|
||||
puts( "\r\n" );
|
||||
}
|
||||
printf( "MOSH CONNECT %s %s\n", network->port().c_str(), network->get_key().c_str() );
|
||||
|
||||
/* don't let signals kill us */
|
||||
struct sigaction sa;
|
||||
|
||||
Reference in New Issue
Block a user