Skip to content

terminal: use one capability policy for image widgets and backend emission #387

Description

@subinium

Priority: P2
Evidence: Executed public PtyBackend/kitty_image output comparison
Baseline: v0.23.0 source 37933f9, audited 2026-09-05. Native execution/compile probes used Rust 1.98.0 on aarch64 macOS unless explicitly stated otherwise.

Problem and Reproduction

A valid2x2 RGBA fixture renders half-blocks on generic xterm and a Kitty payload on Kitty. Kitty identity plus SLT_DISABLE_KITTY=1 emits only the 16-byte synchronized-update wrapper, with neither image nor fallback. Zellij inheriting Kitty identity behaves the same. Widget-side env inference overrides backend policy.

src/context/widgets_display/rich_output.rs:458 · src/context/widgets_display.rs:790 · src/terminal.rs:1372

Scope

  • Resolve protocol support/disable/remote/multiplexer policy once and share it between preparation and emission.
  • Select a usable fallback when a payload will not be emitted.
  • Audit Sixel/iTerm variants for the same split decision.

Expected Effect

Avoid blank image regions when users disable a protocol or run inside a multiplexer.

Acceptance Criteria

  • Assert visible fallback content, not merely absence of Kitty/Sixel escape bytes.
  • Test disable-vs-force precedence, inherited TERM_PROGRAM, SSH and supported multiplexer policies.
  • Default generic terminals and explicit supported-protocol paths retain their existing output.
  • Follow the repository quality gates and the evidence rules in tracking: post-v0.23 correctness, resource efficiency and WASM completion #366; record actual results rather than treating a proposed test as passed.

Boundaries and Dependencies

Byte-emission evidence is not a promise that every physical emulator renders each protocol.

No blocking implementation dependency identified; coordinate shared code with the tracker.

Related closed work: #329, #289, #357. This is a scoped follow-up at the audit baseline, not a claim that every prior fix is absent.

Tracking: #366. This issue records unresolved work, not an implemented fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:terminalsrc/terminal.rs backendbugSomething isn't workingseverity:criticalIncorrect logic or significant bugtype:bugCorrectness: panic, wrong logic, unexpected behavior

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions