From fb4421427ba28166213a949d9fd3878ef578803f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 2 May 2025 13:34:55 +0200 Subject: [PATCH] Host: always set needs_user_terminal for ssh commands, only override prefix if given by user --- pkgs/clan-cli/clan_cli/ssh/host.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/ssh/host.py b/pkgs/clan-cli/clan_cli/ssh/host.py index 1eca93a68..ecd357c38 100644 --- a/pkgs/clan-cli/clan_cli/ssh/host.py +++ b/pkgs/clan-cli/clan_cli/ssh/host.py @@ -122,6 +122,9 @@ class Host: if extra_env is None: extra_env = {} + if opts is None: + opts = RunOpts() + # If we are not root and we need to become root, prepend sudo sudo = "" if become_root and self.user != "root": @@ -132,11 +135,10 @@ class Host: for k, v in extra_env.items(): env_vars.append(f"{shlex.quote(k)}={shlex.quote(v)}") - if opts is None: - opts = RunOpts() - else: - opts.needs_user_terminal = True + if opts.prefix is None: opts.prefix = self.command_prefix + # always set needs_user_terminal to True because ssh asks for passwords + opts.needs_user_terminal = True if opts.cwd is not None: msg = "cwd is not supported for remote commands"