scripts/mosh: Add --no-init option to disable alternate screen mode
Signed-off-by: Anders Kaseorg <andersk@mit.edu> Closes #384. Closes #2.
This commit is contained in:
committed by
Keith Winstein
parent
ed42d31bda
commit
ea3ad786fa
@@ -128,6 +128,12 @@ only port that is forwarded through a firewall to the
|
|||||||
server. Otherwise, \fBmosh\fP will choose a port between 60000 and
|
server. Otherwise, \fBmosh\fP will choose a port between 60000 and
|
||||||
61000.
|
61000.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-\-no\-init
|
||||||
|
Do not send the \fBsmcup\fP initialization string and \fBrmcup\fP
|
||||||
|
deinitialization string to the client's terminal. On many terminals
|
||||||
|
this disables alternate screen mode.
|
||||||
|
|
||||||
.SH ESCAPE SEQUENCES
|
.SH ESCAPE SEQUENCES
|
||||||
|
|
||||||
The escape sequence to shut down the connection is \fBCtrl-^ .\fP
|
The escape sequence to shut down the connection is \fBCtrl-^ .\fP
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ my $port_request = undef;
|
|||||||
|
|
||||||
my $ssh = 'ssh';
|
my $ssh = 'ssh';
|
||||||
|
|
||||||
|
my $term_init = 1;
|
||||||
|
|
||||||
my $help = undef;
|
my $help = undef;
|
||||||
my $version = undef;
|
my $version = undef;
|
||||||
|
|
||||||
@@ -72,6 +74,8 @@ qq{Usage: $0 [options] [--] [user@]host [command...]
|
|||||||
(example: "ssh -p 2222")
|
(example: "ssh -p 2222")
|
||||||
(default: "ssh")
|
(default: "ssh")
|
||||||
|
|
||||||
|
--no-init do not send terminal initialization string
|
||||||
|
|
||||||
--help this message
|
--help this message
|
||||||
--version version and copyright information
|
--version version and copyright information
|
||||||
|
|
||||||
@@ -104,6 +108,7 @@ GetOptions( 'client=s' => \$client,
|
|||||||
'n' => sub { $predict = 'never' },
|
'n' => sub { $predict = 'never' },
|
||||||
'p=s' => \$port_request,
|
'p=s' => \$port_request,
|
||||||
'ssh=s' => \$ssh,
|
'ssh=s' => \$ssh,
|
||||||
|
'init!' => \$term_init,
|
||||||
'help' => \$help,
|
'help' => \$help,
|
||||||
'version' => \$version,
|
'version' => \$version,
|
||||||
'fake-proxy!' => \my $fake_proxy ) or die $usage;
|
'fake-proxy!' => \my $fake_proxy ) or die $usage;
|
||||||
@@ -281,6 +286,7 @@ if ( $pid == 0 ) { # child
|
|||||||
# Now start real mosh client
|
# Now start real mosh client
|
||||||
$ENV{ 'MOSH_KEY' } = $key;
|
$ENV{ 'MOSH_KEY' } = $key;
|
||||||
$ENV{ 'MOSH_PREDICTION_DISPLAY' } = $predict;
|
$ENV{ 'MOSH_PREDICTION_DISPLAY' } = $predict;
|
||||||
|
$ENV{ 'MOSH_NO_TERM_INIT' } = '1' if !$term_init;
|
||||||
exec {$client} ("$client @cmdline |", $ip, $port);
|
exec {$client} ("$client @cmdline |", $ip, $port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,9 @@ Display::Display( bool use_environment )
|
|||||||
posterize_colors = ti_num( "colors" ) < 256;
|
posterize_colors = ti_num( "colors" ) < 256;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if ( !getenv( "MOSH_NO_TERM_INIT" ) ) {
|
||||||
smcup = ti_str("smcup");
|
smcup = ti_str("smcup");
|
||||||
rmcup = ti_str("rmcup");
|
rmcup = ti_str("rmcup");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user