Skip to content

terminal(feat[sixel]): Add stateful XTSMGRAPHICS (#28) - #55

Merged
tony merged 2 commits into
masterfrom
feat/stateful-xtsmgraphics
Nov 28, 2026
Merged

tony merged 2 commits into
masterfrom
feat/stateful-xtsmgraphics

Conversation

@tony

@tony tony commented Nov 28, 2026

Copy link
Copy Markdown
Member

Closes #28 (depends on #54)

Summary

Implements stateful XTSMGRAPHICS (CSI ? Pi ; Pa ; Pv S) SIXEL color-register (Pi = 1) and pixel-geometry (Pi = 2) read, reset, set, and maximum queries (Pa = 1..4) across QueryBehavior, host profiles, Terminal, and libvt.codec.explain().

What changed

  • libvt.config.QueryBehavior, libvt.profiles, and libvt.contrib.tmux.profile.tmux_profile: add xtsmgraphics_enabled, xtsmgraphics_geometry_enabled, xtsmgraphics_set_enabled, sixel_color_registers (256), and max_sixel_color_registers (1024), advertise ;4 in XTERM_PROFILE.identity.da1, disable XTSMGRAPHICS on GHOSTTY_PROFILE / KITTY_PROFILE / LINUX_CONSOLE_PROFILE, and configure tmux_profile(sixel=True) with 1024 read-only color registers and disabled geometry/writes.
  • libvt.terminal.Terminal & libvt.codec: track live SIXEL color registers and geometry overrides across Pa = 1..4 (Ps = 0 ok, Ps = 1 unrecognized Pi, Ps = 2 unrecognized Pa, Ps = 3 disabled/untracked or missing cell dimensions), gate responses on Policy.track_graphics and Policy.emit_replies, reset registers on RIS, and label CSI ? ... S as XTSMGRAPHICS in explain().
  • tests/test_terminal.py, docs/topics/protocols-and-input.md, and CHANGES: unit tests, doctests, and documentation.

@tony
tony force-pushed the feat/kitty-alt-assoc-keys branch from eeea3c5 to 9bd371d Compare November 28, 2026 20:14
@tony
tony changed the base branch from feat/kitty-alt-assoc-keys to master November 28, 2026 20:17
tony added 2 commits November 28, 2026 14:17
why: Host terminals differ on whether XTSMGRAPHICS (CSI ? Pi ; Pa ; Pv S)
is ignored, read-only, or supports pixel-geometry queries and register
writes alongside SIXEL DA1 (;4) advertisement.

what:
- Add xtsmgraphics_enabled, xtsmgraphics_geometry_enabled,
  xtsmgraphics_set_enabled, sixel_color_registers, and
  max_sixel_color_registers to QueryBehavior with bounds validation
- Configure GHOSTTY_PROFILE, KITTY_PROFILE, LINUX_CONSOLE_PROFILE,
  XTERM_PROFILE (DA1 ;4), and tmux_profile(sixel=...) accordingly
why: Applications probing SIXEL support via CSI ? Pi ; Pa ; Pv S expect
stateful color-register and pixel-geometry read, reset, set, and maximum
responses gated on graphics tracking and profile capabilities.

what:
- Implement stateful XTSMGRAPHICS (Pi=1 color registers, Pi=2 geometry,
  Pa=1..4, Ps=0..3) in Terminal._csi_private_q_S, resetting on RIS and
  reporting ;3S when Policy.track_graphics is False
- Decode CSI ? ... S as XTSMGRAPHICS in libvt.codec.explain
- Add tests, doctests, and changelog documentation
@tony
tony force-pushed the feat/stateful-xtsmgraphics branch from d0e040f to 7b23a31 Compare November 28, 2026 20:17
@tony
tony merged commit 2f63840 into master Nov 28, 2026
9 checks passed
@tony
tony deleted the feat/stateful-xtsmgraphics branch November 28, 2026 20:39
@tony tony mentioned this pull request Nov 28, 2026
21 of 28 tasks

This branch was successfully deployed

1 active deployment
docs — 7b23a317 Deployed Nov 28, 2026 by tony via build (3.14) #120
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.

Implement stateful XTSMGRAPHICS (CSI ? Pi ; Pa ; Pv S) color and geometry registers

1 participant