Skip to content

docs(rfd): Add draft RFD D57 for capability-aware terminal theming#770

Merged
JeanMertz merged 1 commit into
mainfrom
pr34
Jun 22, 2026
Merged

docs(rfd): Add draft RFD D57 for capability-aware terminal theming#770
JeanMertz merged 1 commit into
mainfrom
pr34

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

Introduces a new draft RFD proposing a two-layer styling system: a frontend-agnostic semantic styling layer (jp_style crate with Style, Palette, base16 roles, scopes, and themes) and a terminal-specific rendering layer in jp_term/jp_printer.

The terminal sink adapts resolved styling to the terminal it is writing to: downgrading 24-bit color to 256 or 16, selecting a light or dark default theme by detected scheme, and stripping color and unsafe control sequences for non-terminal channels and NO_COLOR.

This addresses two concrete reported failures: inline code being unreadable on light terminals (background set, foreground not), and syntax-highlighted tool output being garbled on non-truecolor terminals such as Apple Terminal (which sets TERM=xterm-256color but does not support 24-bit SGR sequences).

Also adds a note to RFD 075 (tool sandbox and access policy) marking sanitization of terminal escape sequences in tool output as out of scope for that sandbox, pointing to D46's per-sink category-based strip policy as the mechanism that handles it by default.

Introduces a new draft RFD proposing a two-layer styling system: a
frontend-agnostic semantic styling layer (`jp_style` crate with `Style`,
`Palette`, base16 roles, scopes, and themes) and a terminal-specific
rendering layer in `jp_term`/`jp_printer`.

The terminal sink adapts resolved styling to the terminal it is writing
to: downgrading 24-bit color to 256 or 16, selecting a light or dark
default theme by detected scheme, and stripping color and unsafe control
sequences for non-terminal channels and `NO_COLOR`.

This addresses two concrete reported failures: inline code being
unreadable on light terminals (background set, foreground not), and
syntax-highlighted tool output being garbled on non-truecolor terminals
such as Apple Terminal (which sets `TERM=xterm-256color` but does not
support 24-bit SGR sequences).

Also adds a note to RFD 075 (tool sandbox and access policy) marking
sanitization of terminal escape sequences in tool output as out of scope
for that sandbox, pointing to D46's per-sink category-based strip policy
as the mechanism that handles it by default.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz changed the title docs(rfd): Add draft RFD D46 for capability-aware terminal theming docs(rfd): Add draft RFD D57 for capability-aware terminal theming Jun 22, 2026
@JeanMertz JeanMertz merged commit d99e38d into main Jun 22, 2026
15 checks passed
@JeanMertz JeanMertz deleted the pr34 branch June 22, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant