ssh kitten: Fix "Connection closed" message being printed by ssh when running remote commands

Don't force allocate a tty when running remote commands. This
matches ssh behavior as well.
This commit is contained in:
Kovid Goyal
2021-06-21 16:40:07 +05:30
parent fd4c7a4ed2
commit 1c25ed7666
2 changed files with 6 additions and 1 deletions

View File

@@ -266,7 +266,9 @@ def main(args: List[str]) -> NoReturn:
cmd += server_args
else:
hostname, remote_args = server_args[0], server_args[1:]
cmd += ['-t', hostname]
if not remote_args:
cmd.append('-t')
cmd.append(hostname)
terminfo = subprocess.check_output(['infocmp', '-a']).decode('utf-8')
f = get_posix_cmd if use_posix else get_python_cmd
cmd += f(terminfo, remote_args)