Fix TUI startup and test script bugs

- TUI: replace per-call bufio.Scanner with a goroutine+channel reader
  (lineReader) so a single scanner lives for the connection lifetime;
  previous pattern silently dropped messages due to scanner read-ahead
- test-tui.sh / test-network.sh: add `return 0` to wait_port — when the
  port opens and the while condition becomes false, bash returned the
  condition's exit code (1) to the caller, tripping set -e immediately
- .gitignore: use /tui (root-only) instead of tui to avoid ignoring cmd/tui/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Fredrik Johansson
2026-06-21 18:46:40 +02:00
parent 714ac15816
commit 5a0bcee8c6
4 changed files with 47 additions and 24 deletions

View File

@@ -23,7 +23,7 @@ CHARLIE_IPC=19343
NETWORK_NAME="test-$(date +%s)"
DATA_ROOT="/tmp/waste-test"
rm -rf "$DATA_ROOT"
mkdir -p "$DATA_ROOT"
mkdir -p "$DATA_ROOT/bin"
# ── cleanup ───────────────────────────────────────────────────────────────────
PIDS=()
@@ -157,6 +157,7 @@ wait_port() {
exit 1
fi
done
return 0
}
# ── build ─────────────────────────────────────────────────────────────────────