diff --git a/src/play/terminal.rs b/src/play/terminal.rs index 0f1fab5..7d4b6eb 100644 --- a/src/play/terminal.rs +++ b/src/play/terminal.rs @@ -120,6 +120,13 @@ fn park_cursor_below(viewport: Rect) { /// pinned top belongs, this scrolls the screen up first, the same as a /// program whose output ran past the last row before the next line /// printed. +/// +/// This queries the cursor position once here, and `try_init_with_options` +/// queries it again inside `Terminal::with_options`, which does not cache +/// the answer this function already read. Each query is `ESC [ 6 n`, and +/// crossterm blocks up to two seconds waiting for the reply, so a slow or +/// unresponsive terminal makes startup wait close to four seconds, not +/// two. A terminal that actually answers takes milliseconds. fn pin_to_bottom(viewport_height: u16) -> io::Result<()> { let (_, screen_height) = crossterm::terminal::size()?; let (_, cursor_row) = cursor::position()?;