This unlocks pressing `b` in `less` and `more` to scroll backwards.
To facilitate this I had to do a better job at scrolling up and down,
so beef up the code to enable that. Scroll regions still need some
work; test case for that is running vim and then opening help.
Also: fixup the y position when rending rows; it was off by one row.
We now keep track of the dirty status on a per-line basis
and use that status to realize when we need to repaint a portion
of the screen. This reduces the compute cost of redrawing
quite significantly; we're no longer on `top` when we're running
`top`!
The simpler escape sequences were getting a bit boiler-platey and long,
so hoist them up and perform matching at the main level. This has the
side effect of discarding params after a match; that's fine for these
as it only seems to be important for the SGR sequences.
Using the SHM extension of the X server saves us from sending ~1MB of
bitmap data to the server on many screen update operations for a
modestly sized terminal window.
SHM may not be available in some situations so we need to keep a
fallback that basically works. This is done via a helper enum
in xwin.rs.
I've removed the unused Pixmap class; the pixmap concept makes the
most sense for us only when SHM is available.
I thought it would be nice to use the default xterm palette, but
I really hate the contrast of its default blue on black, so switch
to the palette from my xterm config.
Track all the rendition bits described in the SGR section here:
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
Still need to hook up color matching against the color palette
as described for the 256 color mode flavor.