Merge PR #274: fix(setup): handle TerminalMenu init failures with safe fallback

Authored by jdblackstar. Catches runtime exceptions from TerminalMenu
init (e.g. CalledProcessError from tput with unknown TERM like
xterm-ghostty over SSH) and falls through to the text-based menu.
This commit is contained in:
teknium1 2026-03-05 01:26:58 -08:00
commit fe15a2c65c

View file

@ -106,6 +106,10 @@ def prompt_choice(question: str, choices: list, default: int = 0) -> int:
return idx return idx
except (ImportError, NotImplementedError): except (ImportError, NotImplementedError):
pass
except Exception as e:
print(f" (Interactive menu unavailable: {e})")
# Fallback to number-based selection (simple_term_menu doesn't support Windows) # Fallback to number-based selection (simple_term_menu doesn't support Windows)
for i, choice in enumerate(choices): for i, choice in enumerate(choices):
marker = "" if i == default else "" marker = "" if i == default else ""