From 4ca370a8772e5657ca9949e797b7c33214568357 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sun, 16 Aug 2026 07:02:25 +0200 Subject: [PATCH] lib.ec.ssh.Paramiko: Close remote stdin _run_ssh() writes cmd_input to the remote stdin channel but never closes the write side. The channel stays open until the client process exits, so a remote command that reads stdin (cat, a login shell, ...) never sees EOF and blocks forever - including for cmd_input = None, which is supposed to mean non-interactive with stdin from /dev/null. Call shutdown_write() on the channel after writing the input, or immediately when there is none, so the remote command gets EOF. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2 Signed-off-by: Jan Lindemann --- src/python/jw/pkg/lib/ec/ssh/Paramiko.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/python/jw/pkg/lib/ec/ssh/Paramiko.py b/src/python/jw/pkg/lib/ec/ssh/Paramiko.py index 0af7af48..b85b20f4 100644 --- a/src/python/jw/pkg/lib/ec/ssh/Paramiko.py +++ b/src/python/jw/pkg/lib/ec/ssh/Paramiko.py @@ -94,5 +94,6 @@ class Paramiko(Base): raise if cmd_input is not None: stdin.write(cmd_input) + stdin.channel.shutdown_write() exit_status = stdout.channel.recv_exit_status() return Result(stdout.read(), stderr.read(), exit_status, cmd = cmd)