test fix for terminal UI
This commit is contained in:
parent
be870e1a9d
commit
c7d0620f7a
|
|
@ -44,6 +44,9 @@ setup_logging() {
|
||||||
return 0
|
return 0
|
||||||
fi
|
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
|
mkdir -p "$LOG_DIR" 2>/dev/null || true
|
||||||
|
|
||||||
if [[ -z "${LOG_FILE:-}" ]]; then
|
if [[ -z "${LOG_FILE:-}" ]]; then
|
||||||
|
|
@ -212,7 +215,13 @@ step_termux_repo_select_once() {
|
||||||
fi
|
fi
|
||||||
ans="${ans:-Y}"
|
ans="${ans:-Y}"
|
||||||
if [[ "$ans" =~ ^[Yy]$ ]]; then
|
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 </dev/tty >&3 2>&4 || true
|
||||||
|
else
|
||||||
|
termux-change-repo || true
|
||||||
|
fi
|
||||||
ok "Mirror selection completed (or skipped inside the UI)."
|
ok "Mirror selection completed (or skipped inside the UI)."
|
||||||
else
|
else
|
||||||
warn "Mirror selection skipped by user."
|
warn "Mirror selection skipped by user."
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue