diff --git a/docs/changelog.rst b/docs/changelog.rst index b58cbf8bc..3621aaa11 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -18,6 +18,9 @@ To update |kitty|, :doc:`follow the instructions `. - ssh kitten: Support system where the login shell is a non-POSIX shell +- ssh kitten: Fix "Connection closed" message being printed by ssh when running + remote commands + - Add support for the XTVERSION escape code - macOS: Fix a regression in 0.21.0 that broke middle-click to paste from clipboard (:iss:`3730`) diff --git a/kittens/ssh/main.py b/kittens/ssh/main.py index ae44b5d25..42ca7d389 100644 --- a/kittens/ssh/main.py +++ b/kittens/ssh/main.py @@ -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)