From 9d1ea50b9bac404f10ca9e2b1d97657eef43dc19 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 1 Jun 2016 10:50:39 -0400 Subject: [PATCH] mosh: Support --no-init in native 'mosh' wrapper --- packages/mosh/mosh.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/mosh/mosh.cc b/packages/mosh/mosh.cc index 9c306a22a..f2e8d752a 100644 --- a/packages/mosh/mosh.cc +++ b/packages/mosh/mosh.cc @@ -95,6 +95,8 @@ static const char *usage_format = " (example: \"ssh -p 2222\")\n" " (default: \"ssh\")\n" "\n" +" --no-init do not send terminal initialization string\n" +"\n" " --help this message\n" " --version version and copyright information\n" "\n" @@ -163,11 +165,13 @@ int main( int argc, char *argv[] ) string ssh = "ssh"; string predict, port_request, ssh_port; int help=0, version=0, fake_proxy=0; + bool term_init = true; static struct option long_options[] = { { "client", required_argument, 0, 'c' }, { "server", required_argument, 0, 's' }, + { "no-init", no_argument, 0, 'i' }, { "predict", required_argument, 0, 'r' }, { "port", required_argument, 0, 'p' }, { "ssh-port", required_argument, 0, 'P' }, @@ -195,6 +199,9 @@ int main( int argc, char *argv[] ) case 's': server = optarg; break; + case 'i': + term_init = false; + break; case 'r': predict = optarg; break; @@ -459,5 +466,6 @@ int main( int argc, char *argv[] ) setenv( "MOSH_KEY", key.c_str(), 1 ); setenv( "MOSH_PREDICTION_DISPLAY", predict.c_str(), 1 ); + if (!term_init) setenv( "MOSH_NO_TERM_INIT", "1", 1 ); execlp( client.c_str(), client.c_str(), ip.c_str(), port.c_str(), (char *)NULL ); }