Skip to content

Commit 06eba0b

Browse files
committed
fix: auto-proceed installer warnings in headless mode
`SetupLog.wait_continue()` previously blocked on an asyncio Event that could only be set by the Textual `enter` key binding. When the installer runs with `--headless`, Textual has no terminal-attached UI to receive keystrokes, so the WSL/LiveCD environment warning prompt would hang forever waiting for an Enter press that never arrives. Detect headless mode and auto-continue after printing the warning so `./backend.ai install --headless --non-interactive ...` proceeds without human input.
1 parent 3e617fe commit 06eba0b

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

changes/11564.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix the installer hanging on the WSL/LiveCD environment warning when run with `--headless` because the "Press Enter to continue" prompt could not receive keystrokes; in headless mode it now auto-proceeds after printing the warning.

src/ai/backend/install/widgets.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ async def wait_continue(self) -> None:
9797
"""
9898
Block until the user concludes the dialog.
9999
If the user cancels, the result will be None.
100+
In headless mode there is no terminal-attached UI to receive the Enter
101+
keypress, so we auto-proceed instead of blocking forever.
100102
"""
103+
if self.app.is_headless:
104+
self.write(Text.from_markup("\n[dim](headless mode: auto-continuing)[/]\n"))
105+
return
101106
self.write(Text.from_markup("\nPress [bold]Enter[/] to continue...\n"))
102107
self._continue.clear()
103108
await self._continue.wait()

0 commit comments

Comments
 (0)