Skip to content

[CTX-1272] feat(runtime): lock kitty graphics as the default image path (#2131) - #2166

Merged
Xuepoo merged 1 commit into
mainfrom
ctx-1272/feat-2131-kitty-default
Oct 16, 2026
Merged

Xuepoo merged 1 commit into
mainfrom
ctx-1272/feat-2131-kitty-default

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Priority: P1 | Area: render | Labels: feat, P1, area:render | Milestone: 0.0.24 | Task: CTX-1272

Closes #2131.

Summary

Yazi selects its image driver off the honest child environment plus query answers: with no known brand it sends the KGP support probe and reads Unknown { kgp, sixel } off the replies, mapping (true, false) to KgpOld. Bitty answers every clause (a=q OK, non-zero 16t cell probe from #2148, honest Bitty XTVERSION, sixel-free DA1, themed OSC 11), so kitty is selected with no manual flags; the KgpOld wire flow (a=T/C=1/q=2/z=-1 display, a=d,d=A erase) paints and clears. This PR pins that contract with yazi-exact regression tests, and refreshes the stale CTX-0194 rationale which predates kitty support.

Chafa stays name-gated upstream (1.18.3 sends no KGP probe even with --probe=on; verified empirically against a pty): bitty cannot force kitty output without spoofing another terminal identity, so the bitty-side fix keeps advertising bitty itself (TERM_PROGRAM=bitty, sanitized outer fingerprints) and lets query-based detectors select kitty. Sixel honesty is unchanged: DA1 claims no sixel, sixel DCS stays ignored, symbols fallback untouched.

Follow-ups (not this PR): upstream recognition requests -- chafa bitty rule (ghostty #296 precedent) and/or the XTVERSION-gated a=q probe (chafa#349 middle path), yazi bitty Brand mapping to Kgp.

Verification

  • New yazi_probe_battery_reports_kitty_capable (terminal_queries): yazi exact detect bytes -> asserts Gi=31;OK, honest Bitty XTVERSION, non-zero 16t, exact ?6c DA1, themed OSC 11 background.
  • New yazi_kgpold_display_paints_and_erases (kitty_images_present): yazi-exact a=T chunks store+place, q=2 suppresses replies, C=1 holds cursor, tick paints (last_frame_images == 1, non-zero headless pixels), a=d,d=A clears placements.
  • Empirical (pre-PR investigation): chafa 1.18.3 under bitty env emits symbols by default and kitty APC under TERM=xterm-kitty/TERM_PROGRAM=ghostty with identical probes -- name gate confirmed; yazi detect+display flow verified headless against Runtime.
  • cargo fmt --check clean; cargo clippy --workspace --all-targets --locked -- -D warnings clean; cargo test -p bitty-runtime --lib 1003 passed; terminal_queries + kitty_images_present + kitty_queries suites pass; cargo check --target x86_64-pc-windows-gnu --workspace --all-targets clean; cargo +1.85 check clean for touched crates (no let-chains).
  • just ci-local (Quality gates, both shards) green first run: 3522 + 3579 passed. Local recipe notes: needed -P ubuntu-24.04=bitty-act:latest (recipe still maps ubuntu-latest while the workflow pins ubuntu-24.04) and sccache GHA disable.
  • Headed proof staged only (recording/headed-2131-33/staged-runbook.sh, gitignored): owner desktop busy, never disturbed -- yazi preview + chafa renders + btop scrollback check reserved for a free desktop. Headless pixels plus exact-bytes tests cover the same paths.
  • Requesting independent review; NOT merging from this session.

…th (#2131)

Yazi selects its image driver off the honest child environment plus
query answers: with no known brand it sends the KGP support probe and
reads Unknown{kgp, sixel} off the replies, mapping (true, false) to
KgpOld. Bitty answers every clause (a=q OK, non-zero 16t cell probe
from #2148, honest Bitty XTVERSION, sixel-free DA1, themed OSC 11), so
kitty is selected with no manual flags; the KgpOld wire flow
(a=T/C=1/q=2/z=-1 display, a=d/d=A erase) paints and clears. Pin that
contract with yazi-exact regression tests: the full detect battery in
terminal_queries plus the end-to-end display/erase flow in
kitty_images_present.

Chafa stays name-gated upstream (1.18.3 sends no KGP probe even with
--probe=on; verified empirically): bitty cannot force kitty output
without spoofing another terminal identity, so the bitty-side fix is to
keep advertising bitty itself (TERM_PROGRAM=bitty, sanitized outer
fingerprints) and let query-based detectors select kitty. Refresh the
stale CTX-0194 rationale, which predates kitty support, to match.
Sixel honesty is unchanged: DA1 claims no sixel, sixel DCS stays
ignored, symbols fallback untouched. Upstream recognition requests
(chafa bitty rule per ghostty #296 precedent, yazi bitty Brand) are
follow-ups, not this PR.
@Xuepoo Xuepoo added feat Feature P1 Priority: high area:render Area: rendering labels Oct 16, 2026
@Xuepoo Xuepoo added this to the 0.0.24 milestone Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e7c2d56-f609-488e-8f31-eb0a2bd7c94e
📥 Commits

Reviewing files that changed from the base of the PR and between 8eafcb8 and 1524077.

📒 Files selected for processing: 6
  • crates/bitty-pty/src/builder.rs
  • crates/bitty-pty/src/platform/unix.rs
  • crates/bitty-pty/src/platform/windows.rs
  • crates/bitty-pty/tests/spawn_smoke.rs
  • crates/bitty-runtime/tests/kitty_images_present.rs
  • crates/bitty-runtime/tests/terminal_queries.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Xuepoo Xuepoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review requested (CTX-1272 render leftovers, 2/2). Scope: yazi-exact detection battery plus KgpOld end-to-end (tests), CTX-0194 doc refresh for kitty support; no behavior change to parsers, present, or env values. CI watch running; do NOT merge from this session -- merge decision stays with the commander.

@Xuepoo
Xuepoo merged commit b1ce15e into main Oct 16, 2026
17 checks passed
@Xuepoo
Xuepoo deleted the ctx-1272/feat-2131-kitty-default branch October 16, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:render Area: rendering feat Feature P1 Priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kitty graphics protocol should be default for image display

1 participant