Repository navigation
A headless driver has no terminal to ask for a palette - #256
Merged
Merged
Conversation
HeadlessDriver inherited Driver.query_colours, which writes the OSC 10/11/4 queries and waits for their replies. The headless driver's write sends nowhere, so no reply can come, and every headless app that asked waited out the whole timeout before the same TerminalGaveNoPalette. Toad asks once at startup with a 0.25 s deadline, so each of its 594 app tests sat idle 0.25 s (about 2.5 minutes of a serial run). The headless driver now answers at once: its smallest app tests go from 1.18-1.23 s to 0.93-1.04 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Numbers first: Toad's smallest app tests go from 1.18–1.23 s to 0.93–1.04 s each (tests/textual/test_initial_session_title.py, serial, same machine). That's 0.25 s × 594 app tests, about 2.5 minutes of a serial suite run spent waiting for a reply that cannot come.
The defect:
HeadlessDriverinheritedDriver.query_colours(src/textual/driver.py:162). It writes the OSC 10/11/4 queries and waits up totimeoutfor replies.HeadlessDriver.writesends nowhere, so no reply can arrive. Every headless app that asks sits out the whole deadline and then getsTerminalGaveNoPaletteanyway. Toad asks once at startup with a 0.25 s deadline (toad/textual_colours.py:354), so every Toad app test paid it.The fix:
HeadlessDriver.query_coloursraisesTerminalGaveNoPaletteat once. Callers get the same answer they already got, minus the wait.🤖 Generated with Claude Code
https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd