fix: wire terminal query responses (DSR/CPR) back to child PTY#18
Open
aannoo wants to merge 1 commit intopproenca:masterfrom
Open
fix: wire terminal query responses (DSR/CPR) back to child PTY#18aannoo wants to merge 1 commit intopproenca:masterfrom
aannoo wants to merge 1 commit intopproenca:masterfrom
Conversation
The virtual terminal emulator used io::sink() as the wezterm writer, which discarded terminal-to-application responses. This broke TUI apps that query cursor position — notably ratatui's Viewport::Inline mode, which sends \x1b[6n during init and expects a CPR response. Wire the PTY master writer into VirtualTerminal so wezterm's CPR responses flow back to the child process via an ArcWriter adapter that shares the existing PTY writer handle.
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.
Summary
io::sink()as the wezterm writer, silently discarding all terminal-to-application responses (DSR/CPR, DA1, etc.)Viewport::Inlinemode, which sends\x1b[6non init and expects a CPR responseVirtualTerminalvia anArcWriteradapter so wezterm's responses flow back to the child processChanges
pty.rs: Addwriter_handle()to expose a clone of theArc<Mutex<...>>PTY writerpty_session.rs: Pass throughwriter_handle()vterm.rs: Accept aBox<dyn Write + Send>writer parameter instead of usingio::sink()terminal_state.rs: Forward the writer toVirtualTerminalsession.rs: AddArcWriteradapter struct; wire PTY writer intoVirtualTerminalduring session creationTest plan
just readypasses (fmt, clippy, architecture, 451 tests, version check)test_dsr_cursor_position_responseunit test verifies CPR flows through the writer\x1b[1;1Rarrives on child stdinViewport::InlineTUI app renders correctly under agent-tui (previously failed)