Skip to content

Latest commit

 

History

History
127 lines (101 loc) · 12.6 KB

accessibility.md

File metadata and controls

127 lines (101 loc) · 12.6 KB

CLI accessibility — the full-screen renderer and its escape hatch

The interactive surfaces (the bare-invocation Home and relavium chat) render in one of two modes (ADR-0068 §e). This note documents the accessibility trade-off between them and the explicit, always-available path back to the accessible one — an escape hatch, never a trap.

The trade-off

Full-screen (alternate-screen) Inline
Default on a TTY (since 2.6.F Step 4b-3) the fallback / opt-out
Terminal buffer the alternate screen (DECSET 1049) — a fresh buffer with no scrollback the primary buffer + its native scrollback
Scroll-back in-app only (PgUp/PgDn, Ctrl+Home/Ctrl+End, auto-follow) the terminal emulator's own scrollback
Screen readers inherently inaccessible — a raw-mode, full-screen redraw loop carries no live-region / document semantics for assistive tech to follow the emulator's own accessibility support applies (it is ordinary line output)
Mouse text-selection in-app click-drag + copy-on-select (2.6.F Step 6); the emulator's bypass modifier still reaches its own selection native click-drag selection

The full-screen mode is a keyboard-driven, ink-redrawn viewport: it takes over the whole terminal, runs in raw mode, and repaints frames in place. That is what makes long responses scrollable in-app, but it is also inherently inaccessible to screen readers — there is no DOM/live-region model for assistive technology to track, and the alternate buffer discards the scrollback a screen reader would otherwise read. This limitation is intrinsic to a full-screen TUI, not specific to Relavium.

Full-screen mode also enables terminal mouse reporting (DECSET 1002 + 1006) so the wheel scrolls the transcript. The emulator then forwards clicks to Relavium instead of running its own selection — so Relavium runs the selection itself (2.6.F Step 6): drag to select, release to copy. The highlight shows exactly what will be copied, the selection extends past a screenful by auto-scrolling at the viewport's edges, and the copy goes to the system clipboard over OSC 52, which works over SSH and inside a container.

Copy-on-select is on by default. Turn it off with [preferences].copy_on_select = false and the highlight stays while the clipboard is left alone. On a copy a brief Sent to terminal clipboard toast flashes above the status footer for ~2 s (a plain [Sent to terminal clipboard] under NO_COLOR / --no-color) — rendered outside the transcript so it never re-wraps the lines just selected. The toast fires after the local native write completes; enqueueing alone is not delivery. This is not the same as the terminal accepting the clipboard request (see below). A local write failure shows a fixed failure notice without the native error text; a selection too large for the OSC 52 payload shows a transcript note instead.

OSC 52 has no acknowledgement, so a copy can be emitted — and the Sent to terminal clipboard toast shown — but never independently confirmed to have reached the clipboard:

  • tmux honours an application's OSC 52 only under set-clipboard on, and the DCS passthrough only under allow-passthrough on. Relavium emits both forms, so setting either option works; stock tmux sets neither.
  • VS Code's Remote SSH terminal silently drops OSC 52 entirely.

If you would rather keep the emulator's native selection than the wheel, turn mouse reporting off: --no-mouse for one invocation, or [preferences].mouse = false durably (config-spec.md). This also turns off in-app selection and copy-on-select — there is no gesture left to produce them. The keyboard scroll keys (PgUp/PgDn, Ctrl+Home/Ctrl+End) are unaffected. The inline renderer never enables mouse reporting at all, and the bare Home landing does not either — capture is armed only while a chat owns the screen.

Even with mouse reporting on, the emulator's bypass modifier still reaches its own selection — commonly Shift (xterm, GNOME Terminal, Konsole, Windows Terminal), Option (⌥) on iTerm2. Which modifier applies is a property of the terminal, not of Relavium.

Three in-app copy-and-search hatches exist, in a live chat on either surface: /scrollback prints the whole transcript to the primary buffer — where the emulator's own scrollback, search, selection and copy all work — and waits for Enter before repainting; /edit opens the transcript read-only in $EDITOR; /copy puts the whole transcript on the system clipboard over OSC 52 (the unwrapped document, unlike a mouse selection's visual rows). None needs the mouse, and all restore every terminal mode on the way back.

The escape hatch — the inline renderer

The inline renderer is retained, first-class, and keeps the pre-full-screen output mode. Interactive Markdown now uses the shared semantic projection; color-disabled output retains its source markers. It prints to the primary buffer as ordinary lines, so the terminal emulator's native scrollback and screen-reader support apply. Choose it in either of two ways:

  • --no-alt-screen — a per-invocation flag (commands.md): relavium --no-alt-screen, relavium chat --no-alt-screen.
  • [preferences].alt_screen = false — a durable opt-out in ~/.relavium/config.toml (config-spec.md).

The flag overrides the config key. A non-TTY / --json / CI path is always inline regardless (there is no interactive terminal to take over), so machine output is unaffected by the default.

Other accessibility properties (both renderers)

  • Color is never required for meaning. NO_COLOR / --no-color degrade to a legible, color-free rendering; status is carried by text, not color alone.
  • Syntax colour is decoration. A highlighted code block (ADR-0144) only classes text that is already shown, so NO_COLOR / --no-color draw the source unchanged. It uses five named ANSI colours, bold and dim, so the terminal's own theme sets the shades; a comment is dim, and a diff line also carries its + or -. The class list and the colours are in markdown-rendering.md.
  • Keyboard-only. Core navigation needs no mouse — PgUp/PgDn page the transcript, Ctrl+Home/Ctrl+End jump to the top/tail, and auto-follow re-pins to the newest output. Mouse-wheel scrolling is an optional convenience, not a requirement.
  • Untrusted text is sanitized at the display boundary (terminal-escape + bidi/Trojan-Source stripping), so model / MCP / pasted content can neither forge the UI nor spoof the reading order.

MVP-3 Step 2 accepted on development (2026-11-12): approval and tool details provide the same keyboard and color-independent inspection in inline and alternate-screen chat. The interaction contract owns navigation, explicit reveal, escaped invisible characters, full-view coverage and the 80×24 visibility guard. Approval requires the current measured frame to have been flushed; resizing or clipped controls require renewed visibility. Transcript hatches carry conversation text and safe structural tool summaries, while private preview/reveal buffers remain in the live view. These properties do not add assistive-technology semantics to the full-screen renderer.

MVP-4 step 4 (2026-11-19): the command card carries the same properties, in words and not in colour: its standing, directory and warnings are plain rows (⚠ plus the sentence; colour only emphasises), a locked answer is missing from the key row and the lock is explained in a sentence, the open two-step question is the card's plainest text and says that any other key cancels and allows nothing, a note says when an Enter came outside its window, and a control character or an empty argument shows as an escape or (empty) instead of nothing. The contract is command-permissions.md.

MVP-4 step 5 (2026-11-20): the /permissions sheet (ADR-0137 §2) is docked under the conversation like the other overlays, so it works in the inline renderer, which is the accessible mode, and not only in the full-screen one. It reads the same with colour off: the selected row is marked ›, the sections have headings, hidden rows are counted by ▲ n more / ▼ n more, and a withdrawal's question is the message row's text, not a colour. Below 80×24 it says so and arms nothing. Esc closes an idle sheet and, while a withdrawal's question is up, keeps the row instead (a second Esc then closes it); Ctrl+C closes it from either state; neither ever withdraws. The sheet's arming keys are d, Delete and Backspace, and the legend names [d / Del] (the Backspace key arms too and is not on the legend). The contract is command-permissions.md. Since MVP-4 step 7 the same sheet opens on the bare Home and from a bare relavium permissions on a terminal, docked under the Home the same way, with the same words and glyphs and below the same 80×24 floor.

MVP-4 step 6 (2026-11-21): Esc leaves the full view for the card (ADR-0137 §4). The keys are named in words on the screen (Esc back, Ctrl+C stops the turn), not by colour, in the inline renderer as in the full-screen one; stepping back answers nothing and needs no visible frame, so a screen too small to read still says [Ctrl+N] denies · Esc back · Ctrl+C stops the turn. and Esc still leaves it.

MVP-8 (2026-11-23): the Home's new screens (the run view and its cards, the tab host, /agents, the help sheet, the /agent sheet, and the /import, /pricing and export cards; see home.md) carry the properties above and add these, all in words and glyphs and none in colour alone:

  • Every screen names its keys. A legend under each screen lists what it answers to, the way out last (Esc back, Ctrl+Y writes); a tab's legend adds Ctrl+C close just before the way out where the whole legend still fits 80 columns; nothing needs a mouse. A legend leaves out only keys it has no room for, and home.md lists them.
  • State is a glyph and a word. A run, an agent file or a pin reads ✓ completed, ✗ failed, ‖ paused, ✗ invalid, ★ pinned, ? other project; colour only emphasises. An absence has a sentence, never a bare dash.
  • Nothing is hidden without a marker, and every screen fits 80×24. A list longer than its screen is windowed with ▲ N more and ▼ N more (the tab lists, the palette, a select prompt, the help sheet), the highlighted row is always on a drawn row, and below 80×24 a screen says to enlarge the terminal and answers only the keys that leave it.
  • A card is answered only once it is on screen. A card answered by a Ctrl chord (a gate, a budget abort, an MCP consent, and the /import, /pricing and export cards) counts its chord after the frame that shows the card has been painted, after its dwell and quiet gap, and a held key cannot answer the next card; a card that cannot be seen cannot be answered by accident. Two questions are lighter on purpose: the exit guard's Ctrl+Y needs the painted frame and the lockout but no dwell or gap, since a key opened it and it is read before it is answered, and the question whether to continue a run parked on media jobs is a Yes/No with No as its default, so an Enter typed ahead, Esc and Ctrl+C all answer No and nothing starts.
  • Text from files and models stays inside its row. A gate's message is drawn behind a gutter with host glyphs and answer-chord spellings replaced, an agent's prompt is shown as a scrubbed head, and every line passes the display-boundary sanitizer.

These properties do not add assistive-technology semantics to the full-screen renderer.

See also