From 5d15c97e8e3ac8e670b9c1d001a1b9caf4c21683 Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 13:49:17 +0100 Subject: [PATCH 01/13] run with inactivity --- .devcontainer/postCreate.sh | 3 +- .devcontainer/utils.sh | 63 +++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh index 0f2a018..ad503c7 100755 --- a/.devcontainer/postCreate.sh +++ b/.devcontainer/postCreate.sh @@ -5,4 +5,5 @@ cd $EDA_PLAYGROUND_DIR ensure-docker-is-ready -make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file +# Run make with 30s inactivity timeout, retry up to 5 times +run-with-inactivity-timeout 30 5 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file diff --git a/.devcontainer/utils.sh b/.devcontainer/utils.sh index db3cac8..14ef3bf 100644 --- a/.devcontainer/utils.sh +++ b/.devcontainer/utils.sh @@ -6,4 +6,67 @@ function ensure-docker-is-ready { sleep 1 done echo "Docker is ready" +} + +# Run a command with inactivity timeout - restarts if no output for specified seconds +# Usage: run-with-inactivity-timeout [args...] +function run-with-inactivity-timeout { + local timeout_seconds=$1 + local max_retries=$2 + shift 2 + local cmd=("$@") + local attempt=0 + + while [ $attempt -lt $max_retries ]; do + attempt=$((attempt + 1)) + echo "=== Attempt $attempt/$max_retries: ${cmd[*]} ===" + + # Create a temp file to track last output time + local last_output_file=$(mktemp) + date +%s > "$last_output_file" + + # Run command in background, updating timestamp on each output line + ("${cmd[@]}" 2>&1) | while IFS= read -r line; do + echo "$line" + date +%s > "$last_output_file" + done & + local pipe_pid=$! + + # Monitor for inactivity + while kill -0 $pipe_pid 2>/dev/null; do + sleep 5 + local last_output=$(cat "$last_output_file") + local now=$(date +%s) + local idle_time=$((now - last_output)) + + if [ $idle_time -ge $timeout_seconds ]; then + echo "" + echo "=== No output for ${idle_time}s (timeout: ${timeout_seconds}s). Restarting... ===" + # Kill the pipeline and any child processes + pkill -P $pipe_pid 2>/dev/null + kill $pipe_pid 2>/dev/null + wait $pipe_pid 2>/dev/null + rm -f "$last_output_file" + break + fi + done + + # Check if command completed successfully + if wait $pipe_pid 2>/dev/null; then + rm -f "$last_output_file" + echo "=== Command completed successfully ===" + return 0 + fi + + rm -f "$last_output_file" + + # If we're here due to timeout, continue to next attempt + if [ $attempt -lt $max_retries ]; then + echo "=== Retrying in 5 seconds... ===" + sleep 5 + fi + done + + echo "=== Command failed after $max_retries attempts ===" + return 1 } \ No newline at end of file From f0e51416512497fbdd6f26fc09b0161cd032b734 Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 13:51:22 +0100 Subject: [PATCH 02/13] use branch image --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9a4c4a2..be689d2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { "name": "Nokia EDA in GitHub Codespaces", - "image": "ghcr.io/eda-labs/codespaces/base:main", + "image": "ghcr.io/eda-labs/codespaces/base:retry-make", "features": { "ghcr.io/devcontainers/features/docker-in-docker:2": { "version": "latest", From d903379fe71f47ccf2a355f8b33374e7a3f78c38 Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 13:59:15 +0100 Subject: [PATCH 03/13] 60s wait time --- .devcontainer/postCreate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh index ad503c7..2669544 100755 --- a/.devcontainer/postCreate.sh +++ b/.devcontainer/postCreate.sh @@ -6,4 +6,4 @@ cd $EDA_PLAYGROUND_DIR ensure-docker-is-ready # Run make with 30s inactivity timeout, retry up to 5 times -run-with-inactivity-timeout 30 5 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file +run-with-inactivity-timeout 60 5 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file From f1aa9a28375451d1d2b435362b075421607de4b3 Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 14:06:22 +0100 Subject: [PATCH 04/13] another counter approach --- .devcontainer/postCreate.sh | 4 +- .devcontainer/utils.sh | 101 +++++++++++++++++++++++------------- 2 files changed, 68 insertions(+), 37 deletions(-) diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh index 2669544..91889af 100755 --- a/.devcontainer/postCreate.sh +++ b/.devcontainer/postCreate.sh @@ -5,5 +5,5 @@ cd $EDA_PLAYGROUND_DIR ensure-docker-is-ready -# Run make with 30s inactivity timeout, retry up to 5 times -run-with-inactivity-timeout 60 5 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file +# Run make with 90s inactivity timeout, retry up to 5 times +run-with-inactivity-timeout 90 5 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file diff --git a/.devcontainer/utils.sh b/.devcontainer/utils.sh index 14ef3bf..a3a7fa9 100644 --- a/.devcontainer/utils.sh +++ b/.devcontainer/utils.sh @@ -21,49 +21,80 @@ function run-with-inactivity-timeout { attempt=$((attempt + 1)) echo "=== Attempt $attempt/$max_retries: ${cmd[*]} ===" - # Create a temp file to track last output time - local last_output_file=$(mktemp) - date +%s > "$last_output_file" + # Create a temp file to track last output time (using file modification time) + local marker_file=$(mktemp) - # Run command in background, updating timestamp on each output line - ("${cmd[@]}" 2>&1) | while IFS= read -r line; do - echo "$line" - date +%s > "$last_output_file" - done & - local pipe_pid=$! + # Run command, update marker file on each output line + # Use process substitution to avoid subshell issues + local cmd_pid + "${cmd[@]}" 2>&1 & + cmd_pid=$! - # Monitor for inactivity - while kill -0 $pipe_pid 2>/dev/null; do - sleep 5 - local last_output=$(cat "$last_output_file") - local now=$(date +%s) - local idle_time=$((now - last_output)) - - if [ $idle_time -ge $timeout_seconds ]; then - echo "" - echo "=== No output for ${idle_time}s (timeout: ${timeout_seconds}s). Restarting... ===" - # Kill the pipeline and any child processes - pkill -P $pipe_pid 2>/dev/null - kill $pipe_pid 2>/dev/null - wait $pipe_pid 2>/dev/null - rm -f "$last_output_file" + # Process output in background, touching marker file on each line + { + while IFS= read -r line; do + echo "$line" + touch "$marker_file" + done < <(tail -f /proc/$cmd_pid/fd/1 2>/dev/null || cat /proc/$cmd_pid/fd/1 2>/dev/null) + } 2>/dev/null & + local reader_pid=$! + + # Alternative: simpler approach using a FIFO + kill $reader_pid 2>/dev/null + + # Use a named pipe for reliable output tracking + local fifo=$(mktemp -u) + mkfifo "$fifo" + + # Run command with output to fifo + ("${cmd[@]}" 2>&1; echo "___CMD_DONE___") > "$fifo" & + cmd_pid=$! + + local timed_out=false + local cmd_finished=false + + # Read from fifo with timeout checks + while true; do + # Read with timeout using read -t + if IFS= read -r -t "$timeout_seconds" line < "$fifo"; then + if [ "$line" = "___CMD_DONE___" ]; then + cmd_finished=true + break + fi + echo "$line" + else + # Timeout occurred + timed_out=true break fi done - # Check if command completed successfully - if wait $pipe_pid 2>/dev/null; then - rm -f "$last_output_file" - echo "=== Command completed successfully ===" - return 0 - fi + # Cleanup + rm -f "$fifo" "$marker_file" - rm -f "$last_output_file" + if [ "$cmd_finished" = true ]; then + # Wait for command and check exit status + if wait $cmd_pid 2>/dev/null; then + echo "=== Command completed successfully ===" + return 0 + else + echo "=== Command failed with non-zero exit ===" + return 1 + fi + fi - # If we're here due to timeout, continue to next attempt - if [ $attempt -lt $max_retries ]; then - echo "=== Retrying in 5 seconds... ===" - sleep 5 + if [ "$timed_out" = true ]; then + echo "" + echo "=== No output for ${timeout_seconds}s. Restarting... ===" + # Kill the command and all its children + pkill -P $cmd_pid 2>/dev/null + kill $cmd_pid 2>/dev/null + wait $cmd_pid 2>/dev/null + + if [ $attempt -lt $max_retries ]; then + echo "=== Retrying in 5 seconds... ===" + sleep 5 + fi fi done From 2ff7eb3e7316a004cca3c145cbe047f0b39d7c5c Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 14:22:09 +0100 Subject: [PATCH 05/13] vibing the watcher script --- .devcontainer/utils.sh | 101 ++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 57 deletions(-) diff --git a/.devcontainer/utils.sh b/.devcontainer/utils.sh index a3a7fa9..a74b1cf 100644 --- a/.devcontainer/utils.sh +++ b/.devcontainer/utils.sh @@ -21,80 +21,67 @@ function run-with-inactivity-timeout { attempt=$((attempt + 1)) echo "=== Attempt $attempt/$max_retries: ${cmd[*]} ===" - # Create a temp file to track last output time (using file modification time) + # Create marker file - we'll use its modification time local marker_file=$(mktemp) + touch "$marker_file" - # Run command, update marker file on each output line - # Use process substitution to avoid subshell issues - local cmd_pid - "${cmd[@]}" 2>&1 & - cmd_pid=$! - - # Process output in background, touching marker file on each line - { - while IFS= read -r line; do - echo "$line" - touch "$marker_file" - done < <(tail -f /proc/$cmd_pid/fd/1 2>/dev/null || cat /proc/$cmd_pid/fd/1 2>/dev/null) - } 2>/dev/null & - local reader_pid=$! - - # Alternative: simpler approach using a FIFO - kill $reader_pid 2>/dev/null - - # Use a named pipe for reliable output tracking - local fifo=$(mktemp -u) - mkfifo "$fifo" - - # Run command with output to fifo - ("${cmd[@]}" 2>&1; echo "___CMD_DONE___") > "$fifo" & - cmd_pid=$! + # Start the command, piping through a while loop that touches the marker + # Using stdbuf to disable buffering + stdbuf -oL -eL "${cmd[@]}" 2>&1 | while IFS= read -r line; do + echo "$line" + touch "$marker_file" + done & + local pipe_pid=$! local timed_out=false - local cmd_finished=false - # Read from fifo with timeout checks - while true; do - # Read with timeout using read -t - if IFS= read -r -t "$timeout_seconds" line < "$fifo"; then - if [ "$line" = "___CMD_DONE___" ]; then - cmd_finished=true - break - fi - echo "$line" - else - # Timeout occurred + # Monitor loop - check marker file modification time + while kill -0 $pipe_pid 2>/dev/null; do + sleep 5 + + # Get seconds since marker was last modified + local now=$(date +%s) + local last_mod=$(stat -c %Y "$marker_file" 2>/dev/null || echo "$now") + local idle_time=$((now - last_mod)) + + if [ $idle_time -ge $timeout_seconds ]; then timed_out=true + echo "" + echo "=== No output for ${idle_time}s (timeout: ${timeout_seconds}s). Restarting... ===" + + # Kill the entire process group + kill -- -$pipe_pid 2>/dev/null || true + # Kill by parent + pkill -P $pipe_pid 2>/dev/null || true + # Direct kill + kill $pipe_pid 2>/dev/null || true + # Kill any remaining make/kpt processes from this session + pkill -f "kpt live apply" 2>/dev/null || true + + sleep 2 break fi done - # Cleanup - rm -f "$fifo" "$marker_file" + wait $pipe_pid 2>/dev/null + local exit_code=$? + + rm -f "$marker_file" - if [ "$cmd_finished" = true ]; then - # Wait for command and check exit status - if wait $cmd_pid 2>/dev/null; then + if [ "$timed_out" = false ]; then + if [ $exit_code -eq 0 ]; then echo "=== Command completed successfully ===" return 0 else - echo "=== Command failed with non-zero exit ===" - return 1 + echo "=== Command failed with exit code $exit_code ===" + return $exit_code fi fi - if [ "$timed_out" = true ]; then - echo "" - echo "=== No output for ${timeout_seconds}s. Restarting... ===" - # Kill the command and all its children - pkill -P $cmd_pid 2>/dev/null - kill $cmd_pid 2>/dev/null - wait $cmd_pid 2>/dev/null - - if [ $attempt -lt $max_retries ]; then - echo "=== Retrying in 5 seconds... ===" - sleep 5 - fi + # Timed out - retry + if [ $attempt -lt $max_retries ]; then + echo "=== Retrying in 5 seconds... ===" + sleep 5 fi done From 1756729fe813be07bfd2590d2d2f4fc130fca5b3 Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 14:45:27 +0100 Subject: [PATCH 06/13] 180s wait --- .devcontainer/postCreate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh index 91889af..d1747d8 100755 --- a/.devcontainer/postCreate.sh +++ b/.devcontainer/postCreate.sh @@ -5,5 +5,5 @@ cd $EDA_PLAYGROUND_DIR ensure-docker-is-ready -# Run make with 90s inactivity timeout, retry up to 5 times -run-with-inactivity-timeout 90 5 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file +# Run make with 180s inactivity timeout, retry up to 3 times +run-with-inactivity-timeout 180 3 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file From 3d9464ca8aa2499ad4face1c323feac2b4c96ea8 Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 15:21:40 +0100 Subject: [PATCH 07/13] trying more proper font setting --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index be689d2..89925d3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,7 +20,7 @@ "path": "/bin/zsh" } }, - "terminal.integrated.fontFamily": "'JetBrainsMono Nerd Font', 'JetBrainsMono NF', monospace", + "terminal.integrated.fontFamily": "JetBrainsMono Nerd Font, JetBrainsMono, JetBrains Mono, Fira Code Nerd Font, FiraCode Nerd Font, Fira Code, Hasklig, Menlo, Monaco, 'Courier New', monospace", "vscode-eda.edaTargets": { "https://127.0.0.1:9443": { "edaUsername": "admin", From 8f2c5fbef031ddb627528be322cafe7a5c985bdc Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 15:55:11 +0100 Subject: [PATCH 08/13] reduce to 90s --- .devcontainer/postCreate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh index d1747d8..9c7711b 100755 --- a/.devcontainer/postCreate.sh +++ b/.devcontainer/postCreate.sh @@ -5,5 +5,5 @@ cd $EDA_PLAYGROUND_DIR ensure-docker-is-ready -# Run make with 180s inactivity timeout, retry up to 3 times -run-with-inactivity-timeout 180 3 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file +# Run make with 90s inactivity timeout, retry up to 3 times +run-with-inactivity-timeout 90 3 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file From fca64dcc5007a93193a1a3c0dd1bf70242151268 Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 16:12:57 +0100 Subject: [PATCH 09/13] bring back k8s extension --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 89925d3..e7a0026 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,7 +10,7 @@ "customizations": { "vscode": { "extensions": [ - // "ms-kubernetes-tools.vscode-kubernetes-tools", + "ms-kubernetes-tools.vscode-kubernetes-tools", "eda-labs.vscode-eda" ], "settings": { From 4c891e66530743ce616b117b00e785661aabfcae Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 16:13:03 +0100 Subject: [PATCH 10/13] use force kill --- .devcontainer/postCreate.sh | 4 ++-- .devcontainer/utils.sh | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh index 9c7711b..7190677 100755 --- a/.devcontainer/postCreate.sh +++ b/.devcontainer/postCreate.sh @@ -5,5 +5,5 @@ cd $EDA_PLAYGROUND_DIR ensure-docker-is-ready -# Run make with 90s inactivity timeout, retry up to 3 times -run-with-inactivity-timeout 90 3 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file +# Run make with 240s inactivity timeout, retry up to 3 times +run-with-inactivity-timeout 240 3 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file diff --git a/.devcontainer/utils.sh b/.devcontainer/utils.sh index a74b1cf..bafaa5a 100644 --- a/.devcontainer/utils.sh +++ b/.devcontainer/utils.sh @@ -49,16 +49,16 @@ function run-with-inactivity-timeout { echo "" echo "=== No output for ${idle_time}s (timeout: ${timeout_seconds}s). Restarting... ===" + # Forcefully kill (-9) for immediate termination # Kill the entire process group - kill -- -$pipe_pid 2>/dev/null || true + kill -9 -- -$pipe_pid 2>/dev/null || true # Kill by parent - pkill -P $pipe_pid 2>/dev/null || true + pkill -9 -P $pipe_pid 2>/dev/null || true # Direct kill - kill $pipe_pid 2>/dev/null || true + kill -9 $pipe_pid 2>/dev/null || true # Kill any remaining make/kpt processes from this session - pkill -f "kpt live apply" 2>/dev/null || true + pkill -9 -f "kpt live apply" 2>/dev/null || true - sleep 2 break fi done From d27bef61e6f98e70711c4f406e329cb884b6112e Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 16:25:17 +0100 Subject: [PATCH 11/13] show kill log --- .devcontainer/postCreate.sh | 4 ++-- .devcontainer/utils.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh index 7190677..43336ae 100755 --- a/.devcontainer/postCreate.sh +++ b/.devcontainer/postCreate.sh @@ -5,5 +5,5 @@ cd $EDA_PLAYGROUND_DIR ensure-docker-is-ready -# Run make with 240s inactivity timeout, retry up to 3 times -run-with-inactivity-timeout 240 3 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file +# Run make with 120s inactivity timeout, retry up to 3 times +run-with-inactivity-timeout 120 3 make try-eda NO_KIND=yes NO_LB=yes KPT_SETTERS_FILE=/eda-codespaces/codespaces-4vcpu-kpt-setters.yaml \ No newline at end of file diff --git a/.devcontainer/utils.sh b/.devcontainer/utils.sh index bafaa5a..ec3fdd4 100644 --- a/.devcontainer/utils.sh +++ b/.devcontainer/utils.sh @@ -51,13 +51,13 @@ function run-with-inactivity-timeout { # Forcefully kill (-9) for immediate termination # Kill the entire process group - kill -9 -- -$pipe_pid 2>/dev/null || true + kill -9 -- -$pipe_pid || true # Kill by parent - pkill -9 -P $pipe_pid 2>/dev/null || true + pkill -9 -P $pipe_pid || true # Direct kill - kill -9 $pipe_pid 2>/dev/null || true + kill -9 $pipe_pid || true # Kill any remaining make/kpt processes from this session - pkill -9 -f "kpt live apply" 2>/dev/null || true + pkill -9 -f "kpt live apply" || true break fi From 04698611861ccc1ce2f84e90d430f8ef74d1f974 Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 16:26:59 +0100 Subject: [PATCH 12/13] fast killing --- .devcontainer/utils.sh | 43 +++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/.devcontainer/utils.sh b/.devcontainer/utils.sh index ec3fdd4..fa07e15 100644 --- a/.devcontainer/utils.sh +++ b/.devcontainer/utils.sh @@ -21,18 +21,26 @@ function run-with-inactivity-timeout { attempt=$((attempt + 1)) echo "=== Attempt $attempt/$max_retries: ${cmd[*]} ===" - # Create marker file - we'll use its modification time + # Create marker file and pid file local marker_file=$(mktemp) + local pid_file=$(mktemp) touch "$marker_file" - # Start the command, piping through a while loop that touches the marker - # Using stdbuf to disable buffering - stdbuf -oL -eL "${cmd[@]}" 2>&1 | while IFS= read -r line; do + # Run in a subshell that writes its PID, then execs the command + # Output goes through unbuffered to a while loop + ( + echo $BASHPID > "$pid_file" + exec stdbuf -oL -eL "${cmd[@]}" 2>&1 + ) | while IFS= read -r line; do echo "$line" touch "$marker_file" done & local pipe_pid=$! + # Wait briefly for PID file to be written + sleep 0.5 + local cmd_pid=$(cat "$pid_file" 2>/dev/null) + local timed_out=false # Monitor loop - check marker file modification time @@ -47,18 +55,23 @@ function run-with-inactivity-timeout { if [ $idle_time -ge $timeout_seconds ]; then timed_out=true echo "" - echo "=== No output for ${idle_time}s (timeout: ${timeout_seconds}s). Restarting... ===" + echo "=== No output for ${idle_time}s (timeout: ${timeout_seconds}s). Killing processes... ===" + + # Kill the actual command first (most important) + if [ -n "$cmd_pid" ]; then + pkill -9 -P $cmd_pid 2>/dev/null || true + kill -9 $cmd_pid 2>/dev/null || true + fi + + # Kill the pipe + pkill -9 -P $pipe_pid 2>/dev/null || true + kill -9 $pipe_pid 2>/dev/null || true - # Forcefully kill (-9) for immediate termination - # Kill the entire process group - kill -9 -- -$pipe_pid || true - # Kill by parent - pkill -9 -P $pipe_pid || true - # Direct kill - kill -9 $pipe_pid || true - # Kill any remaining make/kpt processes from this session - pkill -9 -f "kpt live apply" || true + # Kill any kpt processes + pkill -9 -f "kpt live apply" 2>/dev/null || true + pkill -9 -f "kpt live" 2>/dev/null || true + echo "=== Processes killed ===" break fi done @@ -66,7 +79,7 @@ function run-with-inactivity-timeout { wait $pipe_pid 2>/dev/null local exit_code=$? - rm -f "$marker_file" + rm -f "$marker_file" "$pid_file" if [ "$timed_out" = false ]; then if [ $exit_code -eq 0 ]; then From 023bb03fa66d9f825a58d5a1dd3c5effd4020eae Mon Sep 17 00:00:00 2001 From: hellt Date: Sat, 10 Jan 2026 16:28:45 +0100 Subject: [PATCH 13/13] nerd font via extension --- .devcontainer/devcontainer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e7a0026..c270703 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,6 +10,7 @@ "customizations": { "vscode": { "extensions": [ + "zongou.vs-seti-jetbrainsmononerdfont", "ms-kubernetes-tools.vscode-kubernetes-tools", "eda-labs.vscode-eda" ], @@ -20,7 +21,9 @@ "path": "/bin/zsh" } }, - "terminal.integrated.fontFamily": "JetBrainsMono Nerd Font, JetBrainsMono, JetBrains Mono, Fira Code Nerd Font, FiraCode Nerd Font, Fira Code, Hasklig, Menlo, Monaco, 'Courier New', monospace", + "editor.fontLigatures": true, + "terminal.integrated.fontLigatures.enabled": true, + "terminal.integrated.fontFamily": "'JetBrainsMonoNL Nerd Font Mono', 'JetBrainsMonoNL Nerd Font', 'JetBrainsMono Nerd Font Mono', 'JetBrainsMono Nerd Font', 'Droid Sans Mono', 'monospace', monospace", "vscode-eda.edaTargets": { "https://127.0.0.1:9443": { "edaUsername": "admin",