Skip to content

feat: expose scrollback buffer with scrollback_rows(), scrollback_row_count(), and clear_scrollback() methods#22

Closed
davidbeesley wants to merge 6 commits into
doy:mainfrom
davidbeesley:main
Closed

feat: expose scrollback buffer with scrollback_rows(), scrollback_row_count(), and clear_scrollback() methods#22
davidbeesley wants to merge 6 commits into
doy:mainfrom
davidbeesley:main

Conversation

@davidbeesley

Copy link
Copy Markdown
  • Adds scrollback_rows() method to retrieve rows from the scrollback buffer
  • Adds scrollback_row_count() method to get the number of rows in the scrollback buffer
  • Adds clear_scrollback() method to clear the scrollback buffer

These methods provide access to the scrollback buffer which was previously internal-only, enabling applications to read terminal history and manage scrollback programmatically.

davidbeesley and others added 6 commits January 19, 2026 16:42
Row was being exported via `pub use row::Row` which triggered 22 clippy
errors for missing documentation, #[must_use] attributes, and panic docs.

Since Row is returned via `impl Iterator<Item = &Row>`, users can still
call its public methods without needing to name the type directly.
…ear_scrollback()

Tests cover:
- scrollback_row_count with various buffer states
- scrollback_rows iterator and cell access
- clear_scrollback resets count and offset
Changed scrollback_rows() to take (start, width) parameters and return
impl Iterator<Item = String>, matching the existing rows() API pattern.

This provides a consistent API and avoids exposing the internal Row type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants