Write shutdown banner directly to browser terminal sockets#51
Merged
Conversation
The terminal is proxied (browser <-> Actor <-> ttyd), so writing the banner to the PTY and relaying it back through ttyd lost the race against process exit on platform-initiated stops (abort, migration, run timeout) — only the idle path's flush delay reliably worked. Write a ready-made ttyd output frame straight to the browser socket instead, so the bytes reach the kernel before the proxy dies; fall back to the PTY devices when no socket is tracked. https://claude.ai/code/session_01KrCLcsSMPpsyWwuTyCzYv8
The shutdown banner writes ttyd's own WebSocket output frames directly to the browser, so an unpinned ttyd could change its wire protocol and silently break banner rendering. Pin it and document how to re-check on a future bump. https://claude.ai/code/session_01KrCLcsSMPpsyWwuTyCzYv8
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.
The terminal is proxied (browser ↔ Actor ↔ ttyd), so #40's approach — write the banner to the PTY and let ttyd relay it back — lost the race against process exit on platform-initiated stops (abort, migration, run timeout). Only the idle path's flush delay reliably worked, so in practice the banner rarely showed.
A hard SIGKILL still shows nothing — no code runs at that point.
https://claude.ai/code/session_01KrCLcsSMPpsyWwuTyCzYv8