refactor(console): route interactive prompts through a themed helper

Adds prompt_user() and uses it for local, remote, and Proton VPN input. Replaces click.prompt on the remote auth path, which ignored the theme and overlapped active Live displays. Remote auth now exits on EOF instead of POSTing an empty answer and spinning the poll loop.
This commit is contained in:
imSp4rky
2026-08-15 18:13:05 -06:00
parent a6cb0231d5
commit db4f0b39f9
6 changed files with 30 additions and 14 deletions
+2 -4
View File
@@ -11,10 +11,9 @@ from pathlib import Path
from typing import Optional
import requests
from rich.text import Text
from unshackle.core.config import config
from unshackle.core.console import console
from unshackle.core.console import prompt_user
from unshackle.core.proxies.proxy import Proxy
log = logging.getLogger("proxies.proton")
@@ -326,13 +325,12 @@ class ProtonVPN(Proxy):
log.error("Proton: unexpected TV login response")
return False
indent = " " * 5
prompt = (
"Proton: open https://account.proton.me/vpn/tv/code\n"
f"Enter code {user_code}, then press Enter to continue..."
)
try:
console.input(Text(indent + prompt.replace("\n", "\n" + indent), style="text"))
prompt_user(prompt)
except EOFError:
return False