Skip to main content

DSR_CURSOR_POSITION_QUERY

Constant DSR_CURSOR_POSITION_QUERY 

Source
pub const DSR_CURSOR_POSITION_QUERY: &[u8] = b"\x1b[6n";
Expand description

Device Status Report cursor-position query — some CLIs (confirmed: Claude Code, on detecting a real TTY) send this immediately and BLOCK waiting for the terminal to reply with ESC[<row>;<col>R before printing anything else at all. A bare portable_pty handle has no attached terminal emulator to answer this automatically — nothing does, on any platform, without code specifically watching for it — so the child hangs forever and the whole capture loop below times out having seen zero bytes. This is the confirmed root cause of issue #2429 (“no PTY output captured… despite correct binary resolution”): isolated repro (a standalone portable_pty harness spawning the exact same binary/args) showed the child’s first and ONLY output was these 4 bytes, then silence: answering this one query unblocked it immediately, and it printed its OAuth URL within half a second.