From 5c889b272d5096c6e91b60033fa81770ff3d73ca Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 17 Jul 2026 14:44:49 +0200 Subject: [PATCH] fix: Store pid for serial debugging (#1288) --- src/serial.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/serial.sh b/src/serial.sh index a70d03f..547e7d9 100644 --- a/src/serial.sh +++ b/src/serial.sh @@ -52,11 +52,18 @@ buildHostArguments() { startHostBinary() { + local pid="" + if enabled "$HOST_DEBUG"; then - set -x - ./host.bin "${HOST_ARGS[@]}" & - { set +x; } 2>/dev/null - echo "$!" > "$HOST_PID" + + { + set -x + ./host.bin "${HOST_ARGS[@]}" & + pid=$! + { set +x; } 2>/dev/null + } 2>&1 + + echo "$pid" > "$HOST_PID" echo else ./host.bin "${HOST_ARGS[@]}" >/dev/null &