Repository navigation
fix(cli): stop the header color query from hanging on macOS - #3569
Merged
fengmk2 merged 2 commits intoNov 25, 2026
Merged
Conversation
macOS poll() does not support /dev/tty: it returns POLLNVAL at once instead of waiting, so the query's 200 ms deadline never applied and each read blocked until the terminal answered. In a terminal that never answers the DA1 sentinel, every command that prints the header hung before it ran. Wait with select() on macOS, which works with /dev/tty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #3568
On macOS,
poll()does not support/dev/tty: it returnsPOLLNVALat once instead of waiting. The header's color query waits withpoll()before each read, so the 200 ms deadline never applied and everyread()blocked until the terminal sent something. In a terminal that never answers theDA1sentinel, every command that prints the header hung before it ran.This PR moves the wait into
wait_readable(). On macOS it usesselect(), which works with/dev/tty, as terminal-colorsaurus does. Other Unix platforms keeppoll(). A descriptor too large for anfd_setcounts as a timeout instead of panicking.The new
header_color_query_no_replysnapshot case setsCOLORTERM=truecolor, sovpsends the query to the runner's terminal, which never answers. Before this change the case timed out after 120 s on macOS. It now passes in under a second. On Linux, wherepoll()works with/dev/tty, it should pass either way; I could only run it on macOS.Checked on macOS 27.2.1 (arm64) with a debug build:
cargo test -p vp_sharedandcargo clippy -p vp_shared --all-targets -- --deny warningspass, with thepoll()branch also compiled by swapping thecfglocally.I did not touch the Warp entry in
is_osc_query_unsupported(). Its comment describes this same hang, so it may no longer be needed, but I can't test Warp.Investigated and written with Claude Code. I reviewed the change and the reproduction and can answer questions about either.