open
https://gitlab.synchro.net/main/sbbs/-/work_items/1408
2026-11-23 14:04:21 -0800
`exec/install-xtrn.js` can install online programs, editors, events and services, but it has no way to register a **file viewer** (the `[viewer:<n>]` sections of `ctrl/file.ini`, configured in SCFG under File Options->Viewable Files). A program that can display files of some type, such as SixelView (`xtrn/sixelview`, see #1402) for PDFs and pictures, can't offer to register itself as the viewer for those types.
## Why `[ini:]` doesn't work for this
- **Section name:** viewers are stored as `[viewer:0]`, `[viewer:1]`, ... `install-xtrn.js` splits an `[ini:<file>:<section>]` name on `:`, so `[ini:file.ini:viewer:6]` targets section `viewer`.
- **Numbering:** even with the full name, the installer would have to pick the next unused viewer number, which `[ini:]` can't compute.
- **Commas:** `[ini:]` splits `values` on `,` before `eval()`ing them, and a viewer's `extension` value is itself a comma-separated list (`PDF,PNG,JPG`).
An `[exec:]` helper script can work around all of this, but each program would carry its own copy of the same logic.
## Proposal
A native section type, for example:
```ini
[viewer:PDF,PNG,JPG,JPEG,GIF]
cmd = ?../xtrn/sixelview/sixelview.js %f
ars = ANSI
ex_mode = EX_STDIO
prompt = Use SixelView to view PDF and picture files
```
- The section name holds the extension list; `cmd`, `ars` and `ex_mode` map to the `[viewer:<n>]` keys of the same names (`ex_mode` `eval()`d against `sbbsdefs.js`, like `settings` for `[prog:]`).
- Appended to `ctrl/file.ini` as `[viewer:<next unused number>]`.
- If an existing viewer already covers any of the same extensions, ask the sysop whether to add the new one anyway (an unattended `-auto` install skips it), since viewers are tried in order and the first one matching the file's extension (whose `ars` the user meets) is used.
- The usual `note` / `prompt` / `required` keys apply, and the existing configuration recycle covers it.
Possibly also worth the same treatment later: testable file types (`[tester:<n>]`), and archive extraction/compression (`[extractor:<n>]`, `[compressor:<n>]`), which have the same section format.
_Authored by Claude (Claude Code), on behalf of @rswindell_
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net