• src/conio/cterm.c cterm.h cterm_test.c src/syncterm/term.c

    From Deuc¿@VERT to Git commit to main/sbbs/master on Sun Apr 19 23:32:38 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/50184d9e6b35956aa4e9ee77
    Modified Files:
    src/conio/cterm.c cterm.h cterm_test.c src/syncterm/term.c
    Log Message:
    cterm: move keyboard encoding from term.c into cterm_encode_key()

    The six per-emulation key-mapping tables, DECBKM backspace/delete logic, ATASCII inverse toggle, Prestel/BEEB reveal toggle, and doorway
    NUL+scancode encoding all consulted state (emulation, extattr, doorway
    mode) that already lives inside struct cterminal, yet the translation
    logic sat in syncterm/term.c. Pulling it into cterm mirrors what cterm
    already does for the inbound (cterm_write) and response (cterm_respond)
    paths, tightens the module boundary, and unblocks multi-instance conio.

    ATASCII inverse state now lives on the cterm as `bool atascii_inverse`,
    read back for the status bar via cterm_atascii_inverse(). All byte
    emission goes through cterm_respond()/response_cb, so cterm stays
    decoupled from conn.c. The doorway short-circuit is absorbed into cterm_encode_key(); term.c keeps only the Alt-Z local filter.

    Adds 18 cterm_test cases covering ANSI raw/F-keys/arrow, DECBKM on/off
    for BS and DEL, VT52 arrow+DECBKM, ATASCII inverse toggle, PETSCII
    F-keys, Prestel '#' remap, BEEB HOME, and three doorway-mode variants (scancode, Alt-Z exemption, doorway off).

    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net