open
https://gitlab.synchro.net/main/sbbs/-/work_items/1406
2026-11-23 13:18:52 -0800
## Summary
Add a `SIXEL` ARS keyword, true when the user's terminal can display Sixel graphics. To support it, the Terminal Server needs to detect Sixel support at logon and record it on the terminal object, for SyncTERM **and** for other Sixel-capable terminals (xterm, mlterm, foot, WezTerm, Windows Terminal, etc.).
## Motivation
Content that only works on a Sixel terminal has no way to gate itself in ARS today. Concrete case: a Viewable File Type entry for images (`jpg,png,gif,...`) that runs SixelView. It must sit *above* a catch-all `*` entry, and without a keyword it is offered to every user, including those on terminals that would show garbage. With the keyword, the entry's Access Requirements would be just `SIXEL`, and non-Sixel users would fall through to the next matching entry. The same applies to menus, display files (`@SHOW:SIXEL@`), and external program/door availability for graphical doors.
#1292 (the `SOUND`/`MOUSE` keywords) left graphics out of scope for exactly this reason: Sixel support is currently detected only in `exec/load/cterm_lib.js` and by the individual doors, never stored server-side.
## Current state
- **Core:** nothing in the Terminal Server knows about Sixel.
- **`cterm_lib.js` `supports_sixel()`:** SyncTERM only. It requires CTerm version 1.189 or later, then queries CTDA for pixel-operation support (SyncTERM in a text-only output mode cannot draw Sixel even when the version is new enough). Any non-CTerm terminal returns false.
- **Doors (termgfx):** each door probes at startup and keeps the result to itself.
## Proposed detection
1. **Non-CTerm terminals:** the logon auto-detection in `answer.cpp` already sends `ESC[0c` (Primary Device Attributes). A CTerm terminal answers with its version report, which is parsed; other ANSI terminals answer with a DA1 report such as `ESC[?63;1;2;4;...c`, which currently falls through the parser and is discarded. **Attribute `4` in that report means Sixel graphics.** Parsing it costs no extra round trip.
2. **SyncTERM / CTerm:** version 1.189 or later plus the CTDA pixel-operations check, matching `supports_sixel()`. CTDA requires 1.207 or later; decide what to assume for 1.189 to 1.206.
3. Store the result on the terminal object (e.g. a `SIXEL` capability bit alongside `MOUSE`), expose it to JS (e.g. via `console`), and have `cterm_lib.js` `supports_sixel()` and the doors able to use it.
## Points to settle
- **Unreliable DA1 answers:** some terminals report attribute `4` without usable Sixel, or support Sixel without reporting it (xterm reports it only when built with Sixel and set to a VT340-class terminal ID). A sysop or user override may be needed, like the existing terminal settings.
- **Size limits:** some terminals discard Sixel images beyond a maximum size (xterm: 1000x1000 by default). Out of scope for a boolean keyword, but worth noting in the docs.
- **Sessionless evaluation (`userdat.c`, web/FTP):** `SIXEL` should be false there, since there is no live terminal.
- **Timing:** as with `SOUND`, the keyword is only reliable after the logon probe; display files shown before it would see false.
- **Documentation:** wiki `access:requirements` page, the `config:file_options` Viewable File Types section (as an example entry), and a `docs/v322_new.md` bullet.
Related: #1292.
- *Authored by Claude (Claude Code), on behalf of @rswindell*
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net