term.scroll

term

scroll(top, bottom, n)

Scroll the rows of a region and leave every other row in place

Moves the text of rows top to bottom by n rows: up for a positive n, down for a negative one. The rows that come in are blank. A terminal that tracks what changed moves the rows that stay and draws the rest.

The call sets a scroll region (DECSTBM), scrolls it (SU or SD) and resets it, in one write. No region outlives the call: text sized by OSC 66 scrolls a region it does not fit in, so a caller writes its rows after the reset. The terminal homes the cursor on both DECSTBM, so the caller places its next write with go.

Does nothing for an n of 0 or a region under two rows.