FABRIC.md items 4.4v/4.4r/4.4ab: keyboard bridge, and simplify to a

full-screen vt100 terminal

4.4v -- keyboard-to-REPL bridge, real and tested:
Refactored KEY-EVENT's per-arch translation logic (keyboard_words.c) into
a shared C function, sk_key_event_poll(), so the REPL bridge reuses item
4.3.5f's already-converged Linux-keycode-namespace event stream instead
of building separate amd64/aarch64/riscv64 tables. repl.c's sk_kbd_getc()
decodes the standard US-QWERTY printable range plus Enter/Backspace/Shift
against that stream; sk_readline() polls it as a second source alongside
console_getc(). Verified via QEMU monitor sendkey injection, and by
Captain Bob typing directly into the live QEMU window over real emulated
PS/2 hardware mid-session (1 1 + . -> 2 ok, then a clean BYE shutdown).

4.4ab -- simplify to a full-screen terminal:
Captain Bob's call, reverting the 640x480 CANVAS box + independent REPL
strip (4.4o/4.4t/4.4x/4.4z) in favor of the simplest shape: the entire
framebuffer is one vt100 terminal, g_vt.cols/rows = fb_width()/fb_height()
divided by cell size, no origin offset, no box, no strip, no border
drawing. The REPL prompt is just the terminal's last scrolling line.
Scrollback, TTF rendering, and SGR color are all box-agnostic and keep
working unmodified.

4.4r -- reframed as a text/graphics mode toggle:
"Hide/show the scroll box" stopped meaning anything once the box was
removed; the underlying need survives as a whole-screen mode switch.
vt100_toggle_graphics() is a two-state machine (VISIBLE/HIDDEN) -- hidden
mode stops the terminal from touching the framebuffer while its logical
state keeps advancing, so direct framebuffer/TTF-TEXT drawing can use the
whole screen; showing again wipes and reuses scrollback_redraw() to
restore the terminal exactly. Reachable two ways, one transition function:
physically via Alt+TAB (4.4y revised from Ctrl+TAB) and programmatically
via the new ALT+TAB FORTH word.

Verified: three-arch clean QEMU boot + logs; amd64 screendump confirms
full-width text with no box/strip artifacts.

Punch list §25 items 4.4v/4.4r/4.4ab complete; 4.4y revised.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-08-12 15:41:26 -04:00
co-authored by Claude Sonnet 5
parent b21aa50a14
commit af20efaa15
19 changed files with 42854 additions and 274 deletions
+5 -5
View File
@@ -91,12 +91,12 @@ void console_fb_scroll_back(uint32_t n);
void console_fb_scroll_fwd(uint32_t n);
/**
* FABRIC.md items 4.4u/4.4w/4.4x: thin wrapper over vt100_strip_draw() --
* see that function's doc comment for the full contract (the REPL
* prompt/input strip, independent of the scrollback box). No-op if the
* framebuffer console was never initialized.
* FABRIC.md item 4.4y-revised: thin wrapper over vt100_toggle_graphics()
* -- see that function's doc comment for the full contract (the
* Alt+TAB graphics/text state machine). No-op if the framebuffer console
* was never initialized.
*/
void console_fb_strip_draw(const char *text);
void console_fb_toggle_graphics(void);
/**
* Write a single character to serial console
+7 -9
View File
@@ -101,16 +101,14 @@ void vt100_putc(char c);
void vt100_puts(const char *s);
/**
* FABRIC.md items 4.4u/4.4w/4.4x: draw the REPL prompt/input strip -- a
* single-line region pinned to the bottom of the screen, independent of
* the scrollback box and its grid/cursor. @p text is the full line to
* show (prompt plus whatever has been typed so far), plain text with no
* ANSI/SGR codes -- the strip renders everything in one fixed color
* (bright white on black, 4.4u). Horizontally scrolls (tail-anchored)
* once @p text exceeds the strip's width. No-op before TTF mode is
* active (vt100_enable_ttf() must have run first).
* FABRIC.md item 4.4y-revised: toggle the full-screen vt100 terminal
* between visible (normal operation) and hidden (graphics mode -- the
* terminal stops drawing, letting direct framebuffer/TTF-TEXT calls show
* through undisturbed). Toggling back to visible does a full redraw of
* the terminal's current on-screen content, restoring it exactly as it
* was. No-op before TTF mode is active.
*/
void vt100_strip_draw(const char *text);
void vt100_toggle_graphics(void);
/* -----------------------------------------------------------------------
* Queries