fix(terminal): release a session slot when its client disconnects mid-write - #258
Merged
Merged
Conversation
…-write A client input write parked on a full PTY input queue held the worker, the session and its semaphore permit until the foreground program exited; killing the process tree does not release a blocked write. Follow kernal-api to v0.1.11 and write client input through PtySession::write_available in 50 ms slices, checking the disconnect flag between them. The blocked-stdin regression now runs on Chromium and WebKit, requires all four slots back within 5 s (the blocked program is `sleep 30`), and asserts no descendant of the CLI still holds a PTY master or runs the blocked program. Fixes #256 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Sep 17, 2026
zackees
added a commit
that referenced
this pull request
Sep 18, 2026
CLI: - `fastled <sketch>` no longer crashes with "Cannot drop a runtime" after starting the server (#269). - `--terminal-cmd` / FASTLED_TERMINAL_CMD runs an agent in the browser terminal, and a configured session survives a page reload through a single-use reattach token (#254, #267). Terminal: - The shell starts in the named directory and emits valid exit frames (#257). - A client that disconnects mid-write releases its session slot (#256, #258). Viewer: - Screen maps registered after setup() now reach the renderer, so sketches like Blink no longer show an empty canvas (#250, #264). - The page no longer overflows the window by 40 px, and the title scales with the window (#268, #270). CI: - Browser terminal suite on Linux, Windows and real Safari (#259, #260). - Linux render smoke that fails on a blank canvas (#247, #266). - Linux dependencies install before setup-soldr, so the dependency cook succeeds (#263); lint covers ci/ (#265); an Intel macOS guest WebKit probe (#251, #261). Co-Authored-By: Claude Opus 5 (1M context) <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 #256.
Cascade
kernal-apiv0.1.11 (fix(pty): let a write give up, and stop teardown hanging on a full queue zackees/kernal-api#295): addsPtySession::write_available(bounded write) andPtyMaster::prepare_for_teardown.kernal-api/kernal-api-buildtov0.1.11and switches the terminal worker to write client input in 50 ms slices, re-checking the disconnect flag between them.Tests
test_terminal_240_disconnect_with_blocked_stdinnow:sleep 30);/dev/ptmxor runs the blockedsleep.Local results:
terminal.rschangemcr.microsoft.com/playwright:v1.62.0-nobleviaplaywright run-server, because Playwright can't install WebKit on NixOS. The browser pointed at the host's loopback server.bash test: 304 Rust + 45 Python passed.-D warnings, ruff, black, isort, pyright: clean. dylint could not run locally (no rustup); CI covers it.🤖 Generated with Claude Code