• ARS: add a SIXEL keyword, detecting Sixel support at logon for all ter

    From Rob Swindell@VERT to GitLab issue in main/sbbs on Mon Nov 23 13:18:53 2026
    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
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Mon Nov 23 13:59:18 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1406#note_11351

    ## SyncTERM output modes (curses, ANSI, etc.) and the CTerm version question

    **Output mode is detectable with CTDA.** SyncTERM can run in output modes that cannot draw graphics (curses, ANSI and other text modes), even on a current version. The CTerm Device Attributes query (`ESC[<0c`) handles this: its reply includes attribute `4` (pixel operations: Sixel and PPM) only when the active output mode supports setting pixels (`src/conio/cterm_cterm.c`, `CONIO_OPT_SET_PIXEL`, which only the bitmap output modes set in `src/conio/bitmap_con.c`). A text-mode SyncTERM omits `4`. This is the check `cterm_lib.js` `supports_sixel()` already makes.

    **The "1.189 to 1.206" question from the description is moot.** Sixel support was added on 2018-02-02 (c969052722) and CTDA on 2018-02-09 (6b0845deda), with no SyncTERM release in between. Every released SyncTERM with Sixel also answers CTDA. Proposed rule for CTerm terminals: version 1.207 or later **and** CTDA attribute `4`; anything older is treated as no Sixel.

    **Implementation note:** the logon auto-detection does not send CTDA today. Send `ESC[<0c` only after a CTerm version report has been received (one extra round trip, SyncTERM users only), rather than adding it to the initial probe string, where non-CTerm terminals would receive a `CSI <` sequence they may not handle cleanly.

    - *Authored by Claude (Claude Code), on behalf of @rswindell*

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Mon Nov 23 14:17:00 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1406#note_11357

    ## Detecting Sixel in non-CTerm terminals: termgfx's method and real-world DA1 replies

    **termgfx already does this.** `src/doors/termgfx/termgfx_termio.c` sends both DA1 (`ESC[c`) and CTDA (`ESC[<c`) to **every** terminal at startup and treats attribute `4` in either reply as Sixel support. The server-side detection can use the same rule.

    **Correction to my previous comment:** I recommended sending CTDA only after a CTerm version report arrives, to avoid sending `CSI <` to other terminals. termgfx has sent it unconditionally to all terminals without known problems, so adding `ESC[<c` to the initial logon probe string (no extra round trip) is a reasonable option.

    **DA1 replies received at logon on Vertrauen** (from the terminal server's auto-detection debug log; counts are logons, not distinct users; terminal identifications are likely, not verified):

    | DA1 reply | Logons | Attr 4? | Likely terminal |
    |---|---|---|---|
    | `?1;2c`, `?1;0c`, `?6c`, `?50;86;84;88c`, `?128;...` | about 850 | no | VT100/VT102-class clients (PuTTY, Linux console, older BBS clients) |
    | `?61;4;6;7;14;21;22;23;24;28;32;42;52c` | 20 | yes | Windows Terminal 1.22+ | | `?62;1;4c`, `?62;4c`, `?62;4;22c`, `?62;4;9;22c`, `?62;4;22;28;52c`, `?1;2;4c`, `?64;1;2;4;6;17;18;21;22;52c` | 65 | yes | various modern terminals (foot, WezTerm, iTerm2, mlterm, etc.) |
    | `?64;1;2;6;9;15;...c` | 13 | no | xterm in its default VT420 mode |
    | `?65;1;9c` | 5 | no | GNOME Terminal (VTE) |

    **Accuracy of "DA1 or CTDA reports 4":**

    - **False positives** appear rare: no terminal is known to report `4` and be unable to draw Sixel. Drawing *well* is a separate matter (xterm discards images over 1000x1000; palette sizes vary), which termgfx handles with XTVERSION and `ESC[14t` canvas queries. A boolean ARS keyword doesn't need those.
    - **False negatives** are predictable:
    - xterm reports `4` only when started as a VT340-class terminal (`-ti vt340`), even if built with Sixel.
    - tmux, screen and mosh answer DA1 themselves, hiding the real terminal. tmux 3.4+ reports `4` only when built with Sixel; screen and mosh never do.

    A per-user override (force Sixel on/off), already listed under "Points to settle", would cover both false-negative cases.

    - *Authored by Claude (Claude Code), on behalf of @rswindell*

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