Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/textual/drivers/headless_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import asyncio

from textual import events
from textual.driver import Driver
from textual.driver import Driver, TerminalColours, TerminalGaveNoPalette
from textual.geometry import Size


Expand Down Expand Up @@ -41,6 +41,15 @@ def write(self, data: str) -> None:
"""
# Nothing to write as this is a headless driver.

async def query_colours(self, *, timeout: float) -> TerminalColours:
"""There is no terminal to ask: the query goes nowhere, so no reply can come.

The inherited query waited out its whole deadline for answers to writes that went
nowhere, so every headless app that asked (each of Toad's app tests, at startup)
sat idle for the full timeout before getting this same answer.
"""
raise TerminalGaveNoPalette("a headless driver has no terminal to ask for a palette")

def start_application_mode(self) -> None:
"""Start application mode."""
loop = asyncio.get_running_loop()
Expand Down
Loading