pub fn size_with_contents(&self) -> (usize, u16) {
        let cols = self.size.cols;
        let last_row_with_content = self.all_rows().enumerate().fold(
            0,
            |last_row_with_contents, (row_index, row)| {
                if row.is_blank() {
                    last_row_with_contents
                } else {
                    row_index
                }
            },
        );
        (last_row_with_content + 1, cols)
    }
Size of screen without trailing blank rows
crates/turborepo-vt100/src/grid.rs