open
https://gitlab.synchro.net/main/sbbs/-/work_items/1338
## Summary
Replace the node-spy windows in sbbsctrl (`src/sbbs3/ctrl/SpyFormUnit.cpp`) with ciolib windows driven by cterm, so that a spied node renders the way
the user's own terminal renders it, using the same emulation code as
SyncTERM.
## Current behavior
- The spy form embeds `TEmulVT` (`emulvt.pas`), a Borland VCL ANSI/VT
emulator, drawn with a Windows font (default "Terminal", 9pt).
- From the node's `terminal.ini` it uses `cols` and `rows` to size the
emulator and `chars` to set a UTF-8 flag. `type` is only shown in the
window caption, so a PETSCII session is still interpreted as ANSI.
- Anything beyond basic ANSI is lost or shown as garbage: 256-color and
24-bit SGR, loadable fonts, CTerm extensions, sixel/pixel graphics,
PETSCII, and the other emulations cterm supports.
- The spy form is tied to the Borland build, so none of it is available
to sbbscon, the NT services, or a 64-bit build (#587).
## Proposal
Render each spied node in a ciolib window (GDI or SDL) with a `cterminal` created to match the node's `terminal.ini`:
- `type` selects the cterm emulation (ANSI-BBS, PETSCII, and so on).
- `cols` and `rows` size the window, and it is re-created when
`terminal.ini` changes.
- `chars = UTF-8` gets the UTF-8 to CP437 translation.
- Keystrokes go through `cterm_encode_key()`, so arrows and function
keys reach the node in the encoding its emulation expects.
`src/sbbs3/umonitor/spyon.c` already does all of this on *nix. Its Win32
branch is a stub ("Spying not supported on Win32 yet!") because the
terminal server only creates local spy sockets on *nix.
## Design points
- **One window per process.** ciolib keeps global state, so several
simultaneous spy windows mean one process per spied node. That points
to a small standalone spy program that sbbsctrl launches from the
Node list's Spy command, rather than ciolib linked into sbbsctrl.
- **Transport on Windows.** sbbsctrl reads `startup->node_spybuf[]` and
writes `node_inbuf[]` in-process. An external spy process needs
another path. Candidates:
- a Windows equivalent of the per-node local spy socket (localhost
TCP or a named pipe);
- the existing MQTT `node/<n>/output` and input topics, which would
also allow spying from another machine but requires a broker.
- **Shared code.** The same program could back umonitor's spy on
Windows and replace `spyon.c`'s private copy of the cterm setup.
- **Keyboard gating.** Keep the "Keyboard Active" toggle; spy input
should stay off unless the sysop enables it.
- **Settings migration.** `SpyTerminalFont*`, `SpyTerminalWidth` and
`SpyTerminalHeight` in the sbbsctrl registry/ini settings become
obsolete; window scaling would be ciolib's.
## Out of scope
- The web-based node spy (#683).
- Changes to what the terminal server writes to the spy stream.
— *Authored by Claude (Claude Code), on behalf of @rswindell*
--- SBBSecho 3.38-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)