Display original command line argv via no-op flag.

Improves 679b819216 to make it simpler to
ignore mosh-client from OS X Terminal.app's "Ask before closing" process
list. (See: http://superuser.com/a/254647)

Moreover, the command displayed from ps is a completely functional one,
which was not the case in the previous approach, that mangles `argv[0]`.

Fixes #742.
This commit is contained in:
Jaeho Shin
2016-04-02 02:55:38 -07:00
committed by John Hood
parent 09bdc7caae
commit d636845c8d
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -431,7 +431,7 @@ if ( $pid == 0 ) { # child
$ENV{ 'MOSH_KEY' } = $key;
$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);
}
sub shell_quote { join ' ', map {(my $a = $_) =~ s/'/'\\''/g; "'$a'"} @_ }