summaryrefslogtreecommitdiffstats
path: root/CONTEXT.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-07-31 17:42:21 +0200
committersalmonik <salmonik@tuta.io>2026-07-31 17:42:21 +0200
commita2ffb8358cf4f4fc7230b5307c651d5badab0860 (patch)
tree5412fa837a6832ca078443e7668a776ee760f75c /CONTEXT.md
parentvt: decode UTF-8, render box-drawing/arrow glyphs procedurally (diff)
downloadrs-dos-a2ffb8358cf4f4fc7230b5307c651d5badab0860.tar.gz
rs-dos-a2ffb8358cf4f4fc7230b5307c651d5badab0860.zip
vt: don't strand stale inverse cursor cells on scroll/clear
The cursor was blitted as an inverse-video cell directly onto the framebuffer, but that inversion was never recorded. RENDERED (the diff grid) only stored the logical cell, so when scrolling shifted the raw pixels up (gop::shift_up), the stale inverse block rode along while the grids said 'blank' — and blank-vs-blank never re-blits. Result: a cursor-shaped block at the end of every scrolled line, surviving even 'clear'. - flush() now mirrors the inverse colours into RENDERED when drawing the cursor (and restores RENDERED when erasing it), and the diff loop skips the visible cursor cell (owned by the cursor pass). Any scroll/clear then sees CELLS != RENDERED at a stale-inverse position and repaints it. - memory.rs heap self-test: snapshot heap state before its own allocations and assert the heap returns to that state, instead of asserting it coalesces to a single empty block. The vt cell grids (allocated earlier in boot) made the old 'free_blocks == 1' check fail; the new check is correct regardless of prior live allocations. Verified in QEMU: hexdump /dev/mem streams hundreds of lines, ^C, screendump shows exactly one inverse cell (the live cursor); 'clear' leaves exactly one (the fresh prompt cursor). heap self-test OK again.
Diffstat (limited to 'CONTEXT.md')
-rw-r--r--CONTEXT.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/CONTEXT.md b/CONTEXT.md
index 20c60f7..a1ef4bb 100644
--- a/CONTEXT.md
+++ b/CONTEXT.md
@@ -106,7 +106,9 @@ Single Rust crate (`x86_64-unknown-uefi` target). Module breakdown:
106- `vt.rs` — terminal emulator: cell grid, cursor, ANSI CSI parser (H/J/K, 106- `vt.rs` — terminal emulator: cell grid, cursor, ANSI CSI parser (H/J/K,
107 cursor moves, SGR 16-colour, `?25l/h`), dirty-cell blitting, UTF-8 107 cursor moves, SGR 16-colour, `?25l/h`), dirty-cell blitting, UTF-8
108 decoding (box-drawing `│`/`═`, arrows `←↑→↓`, em dash `—` render 108 decoding (box-drawing `│`/`═`, arrows `←↑→↓`, em dash `—` render
109 procedurally instead of `?`) 109 procedurally instead of `?`). The inverse cursor is mirrored into the
110 rendered grid so scrolling / `clear` can never strand stale inverse
111 cells on the framebuffer.
110- `tty.rs` — line discipline: canonical `read_line` (echo, line buffer, 112- `tty.rs` — line discipline: canonical `read_line` (echo, line buffer,
111 ^C/^D) and raw `read_byte` (terminal byte protocol: arrows → `ESC [ A–D`, 113 ^C/^D) and raw `read_byte` (terminal byte protocol: arrows → `ESC [ A–D`,
112 ^X → `0x18`, …) 114 ^X → `0x18`, …)