https://gitlab.synchro.net/main/sbbs/-/commit/9ac7162c62da107a8bfbcada
Modified Files:
exec/load/cterm_lib.js
Log Message:
cterm_lib.js: determine capabilities via CTDA, not just the CTerm version
SyncTERM can be built without graphics or audio support and can run in
video output modes (e.g. Win32 Console, curses) that support neither
pixel operations nor loadable fonts nor palette redefinition, so the
CTerm version number alone cannot establish what the terminal can
actually do right now. The CTerm Device Attributes query (CSI < c),
introduced in cterm.c rev 1.207 (6b0845deda, yoga-3-mold), reports the capabilities of the current output mode, but this library only
consulted it for sixel support.
- query_ctda() now caches its result in console.cterm_da (persistent
among contexts, like cterm_version; a failure is cached too, so an
unanswered query can time out at most once per session) and is gated
on the new cterm_version_supports_ctda (1207), so pre-CTDA and
non-CTerm terminals are never sent the query at all.
- supports_fonts(): a prior font operation result still short-circuits
(0 = true, error = false), but the initial 99 sentinel
(CTERM_NO_SETFONT_REQUESTED) says nothing about the output mode and
was misread as "supported"; it now falls through to the CTDA
loadable-fonts and font-select attributes, or returns undefined
(unsure) for CTerm versions too old to answer.
- supports_palettes(): was a pure version check (its comment admitted
it could be wrong in some video modes); now answered from the CTDA
palette attribute, or undefined for pre-CTDA CTerm versions.
- bright_background(): skips the (i)CE color sequences only when the
terminal positively reports (via CTDA) that the current mode lacks
bright-background support; non-CTerm terminals (termsetup.js and
logon.js call this for any ANSI terminal) still receive the
sequences unconditionally.
Callers already treat undefined as "unsure" (fonts.js and xbimage.js
test != false / === false), so best-effort behavior is preserved for
terminals that cannot be queried.
Co-Authored-By: Claude Fable 5 <
noreply@anthropic.com>
--- SBBSecho 3.37-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)