2 Grid output, cursor and attributes🔗ℹ

  • (char-frame) returns the current screen as plain text.

  • (screen->text g) / (screen->lines g) render a given grid; #:trim-right? defaults to #t.

  • (screen-ref g row col) returns a cell; cell-text, cell-fg, cell-bg and cell-attrs read it. (style->string c) renders a readable style such as "fg#1 bold".

  • (screen-current-style g) reports the SGR state that the next character would carry.

  • (screen-styled-cells g) lists all non-default cells; (screen-attr-ranges g) compresses attributes into per-row ranges.

  • (get-cursor) returns (row, col) 1-based (as in base); (screen-cursor g) returns 0-based.