SB-002-TERMINAL_CORE.md
(P0, 297 lines)
- Core terminal emulation with VT100/ANSI compatibility
- Data structures:
d3tui_term_config_t (width, height,
scrollback, colors, cursor blink), d3tui_cell_t (codepoint,
fg/bg color, attributes), d3tui_terminal_t (opaque)
- Public API: create/destroy, input (putc/puts), state queries
(get_cell, get_cursor), buffer ops (clear, scroll), scrollback
navigation, configuration
- Default 16-color VGA palette defined as
D3TUI_DEFAULT_PALETTE[16]
- Supported escape sequences: cursor home/movement, erase, attributes
(bold/underline/reverse), colors (16 foreground + 16 background), scroll
regions, save/restore cursor
- Performance targets: buffer updates < 1ms for 80x25, scrollback
< 10ms for 1000 lines
- Memory budget: ~38.4KB for 80x60 + scrollback mitigation via
256-line limit