From c7d0620f7a0e00e5e093f1700f254c4c25013772 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Mon, 5 Jan 2026 04:18:35 -0600 Subject: [PATCH] test fix for terminal UI --- android/0_termux-setup_v2.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/android/0_termux-setup_v2.sh b/android/0_termux-setup_v2.sh index c87dc18..dc32d62 100644 --- a/android/0_termux-setup_v2.sh +++ b/android/0_termux-setup_v2.sh @@ -44,6 +44,9 @@ setup_logging() { return 0 fi + # Save original console fds so interactive tools still work after we redirect stdout/stderr. + exec 3>&1 4>&2 + mkdir -p "$LOG_DIR" 2>/dev/null || true if [[ -z "${LOG_FILE:-}" ]]; then @@ -212,7 +215,13 @@ step_termux_repo_select_once() { fi ans="${ans:-Y}" if [[ "$ans" =~ ^[Yy]$ ]]; then - termux-change-repo || true + # Logging redirects stdout/stderr to pipes, which can break the UI. + # Run it using /dev/tty and the original console fds (3/4). + if [[ -r /dev/tty ]]; then + termux-change-repo &3 2>&4 || true + else + termux-change-repo || true + fi ok "Mirror selection completed (or skipped inside the UI)." else warn "Mirror selection skipped by user."