Allow non-inserting prediction.
This may be useful for users who find prediction's activity right of the cursor distracting. Prediction underscoring is still a little weird sometimes, it replays a history of known/unknown changes as acks come in from the server.
This commit is contained in:
@@ -65,6 +65,8 @@ my $server = 'mosh-server';
|
||||
|
||||
my $predict = undef;
|
||||
|
||||
my $overwrite = 0;
|
||||
|
||||
my $bind_ip = undef;
|
||||
|
||||
my $use_remote_ip = 'proxy';
|
||||
@@ -97,6 +99,8 @@ qq{Usage: $0 [options] [--] [user@]host [command...]
|
||||
-n --predict=never never use local echo
|
||||
--predict=experimental aggressively echo even when incorrect
|
||||
|
||||
-o --overwrite prediction overwrites instead of inserting
|
||||
|
||||
-4 --family=inet use IPv4 only
|
||||
-6 --family=inet6 use IPv6 only
|
||||
--family=auto autodetect network type for single-family hosts only
|
||||
@@ -150,6 +154,7 @@ sub predict_check {
|
||||
GetOptions( 'client=s' => \$client,
|
||||
'server=s' => \$server,
|
||||
'predict=s' => \$predict,
|
||||
'overwrite|o!' => \$overwrite,
|
||||
'port=s' => \$port_request,
|
||||
'a' => sub { $predict = 'always' },
|
||||
'n' => sub { $predict = 'never' },
|
||||
@@ -200,6 +205,9 @@ if (!$have_ipv6) {
|
||||
# Force IPv4.
|
||||
$family = "inet";
|
||||
}
|
||||
if ( $overwrite ) {
|
||||
$ENV{ "MOSH_PREDICTION_OVERWRITE" } = "yes";
|
||||
}
|
||||
|
||||
if ( defined $port_request ) {
|
||||
if ( $port_request =~ m{^(\d+)(:(\d+))?$} ) {
|
||||
|
||||
Reference in New Issue
Block a user