lib.util.run_cmd(): Fix forgotten cmd_input #132

Merged
Jan Lindemann merged 1 commit from jan/feature/20261003-lib-util-run-cmd-fix-forgotten-cmd-input into master 2026-10-03 09:07:17 +02:00 AGit
Owner

lib.util.run_cmd(): Fix forgotten cmd_input

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().

#### lib.util.run_cmd(): Fix forgotten cmd_input `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()`.
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
55db326898
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
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-10-03 08:56:59 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!132
No description provided.