We weren't quite right with handling the cursor around double-width
characters. We're now a bit more robust at this because we're
clustering and taking pains to consider the printable width of the
cell as well as the width of the shaped (eg: with contextual ligatures)
glyph.
There may still be issues with contextual ligatures of length 3,
but I haven't managed to nail down exactly the issue yet.
This eliminates the zsh reversed % artifact issue.
Added a feature flag to turn on diagnostics even in release mode;
`cargo run --release --features debug-escape-sequences`
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.