lib.util.run_cmd(): Fix forgotten cmd_input
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m25s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m49s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m0s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m56s
CI / Packaging test (push) Successful in 0s

jw-pkg secrets list-secrets spams the console without --interactive=false
because it thinks it should query packages and files in interactive mode.

The underlying bug is that run_cmd() derives the interactive flag of a
freshly created Local context from cmd_input, but it never forwards
cmd_input to ExecContext.run().  Since run() defaults to
InputMode.OptInteractive, an explicit cmd_input is silently ignored: a byte
string is not fed to the command's stdin, InputMode.Auto is downgraded to
non-interactive, and with a caller-provided ExecContext the requested mode
is lost in all cases.

Forward cmd_input in kwargs so the requested input mode reaches run().

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.99.2
This commit is contained in:
Jan Lindemann 2026-10-03 08:39:13 +02:00
commit 55db326898
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -53,6 +53,7 @@ async def run_cmd(
interactive = cmd_input == InputMode.Interactive interactive = cmd_input == InputMode.Interactive
ec = Local(verbose_default = verbose, interactive = interactive) ec = Local(verbose_default = verbose, interactive = interactive)
kwargs['verbose'] = verbose kwargs['verbose'] = verbose
kwargs['cmd_input'] = cmd_input
return await ec.run(*args, **kwargs) return await ec.run(*args, **kwargs)
async def run_curl( async def run_curl(