[PR #386] Preliminary image support #503

Open
opened 2026-03-02 23:46:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/386
Author: @acoliver
Created: 12/5/2025
Status: 🔄 Open

Base: mainHead: feature/terminal-images


📝 Commits (10+)

  • 552c771 Add preliminary terminal image support
  • 3317e4c Merge branch 'main' into feature/terminal-images
  • 52061c3 Fix react workspace dependency
  • c8ebb3c Fix nested scrollbox clipping by intersecting scissor rects
  • 1b05443 Merge remote-tracking branch 'acoliver/feature/clip-fix' into feature/terminal-images
  • 0e123c2 Merge branch 'main' into feature/terminal-images
  • fabb670 Merge origin/main into feature/terminal-images
  • 2dbbcca Fix renderer image formatting and types
  • f40c04b Pin Bun to 1.2.2 for CI stability and switch image loading to jimp
  • 2e9ca16 Use latest Bun with serial test concurrency for CI

📊 Changes

20 files changed (+486 additions, -13 deletions)

View changed files

📝 .github/workflows/build-core.yml (+4 -0)
📝 .github/workflows/build-solid.yml (+6 -0)
📝 bun.lock (+15 -1)
packages/core/src/graphics/protocol.ts (+41 -0)
packages/core/src/renderables/Image.ts (+54 -0)
📝 packages/core/src/renderables/index.ts (+1 -0)
📝 packages/core/src/renderer.ts (+210 -5)
📝 packages/core/src/testing/test-recorder.ts (+3 -3)
packages/core/src/tests/graphics.protocol.test.ts (+58 -0)
📝 packages/core/src/tests/renderer.control.test.ts (+2 -2)
packages/core/src/tests/renderer.images.test.ts (+70 -0)
📝 packages/core/src/types.ts (+3 -0)
📝 packages/react/jsx-namespace.d.ts (+2 -0)
📝 packages/react/src/components/index.ts (+2 -0)
📝 packages/react/src/types/components.ts (+4 -0)
📝 packages/solid/jsx-runtime.d.ts (+2 -0)
📝 packages/solid/src/elements/hooks.ts (+1 -1)
📝 packages/solid/src/elements/index.ts (+2 -0)
📝 packages/solid/src/reconciler.ts (+2 -1)
📝 packages/solid/src/types/elements.ts (+4 -0)

📄 Description

Add experimental terminal image rendering support with pixel sizing and React exposure.

Highlights:

  • New Image renderable that accepts pixelWidth/pixelHeight and fit modes (contain/cover/fill) with sharp-based scaling.
  • Renderer loads/caches images, emits kitty/iTerm2 graphics escapes, deletes kitty ids on move/resize, and surfaces pixelResolution via capabilities and a pixelResolution event.
  • React type exports and components include Image; tests cover graphics protocol parsing and renderer image path.

Notes:

  • Native build/tests not run here; JS tests only.
  • Pixel resolution query/response handled in JS; header sizing in downstream apps should use the exposed resolution and avoid hardcoded px-per-cell fallbacks.

Addresses #387


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/386 **Author:** [@acoliver](https://github.com/acoliver) **Created:** 12/5/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/terminal-images` --- ### 📝 Commits (10+) - [`552c771`](https://github.com/anomalyco/opentui/commit/552c7717fc0546ea323470d35a187cd7942127c3) Add preliminary terminal image support - [`3317e4c`](https://github.com/anomalyco/opentui/commit/3317e4cd5286c114e3b2d85b72a90250ead77bee) Merge branch 'main' into feature/terminal-images - [`52061c3`](https://github.com/anomalyco/opentui/commit/52061c3a5aaf6e0ac8d919f0c96a14e16ad038de) Fix react workspace dependency - [`c8ebb3c`](https://github.com/anomalyco/opentui/commit/c8ebb3c226001b2bb548cc306522ea6181fae31b) Fix nested scrollbox clipping by intersecting scissor rects - [`1b05443`](https://github.com/anomalyco/opentui/commit/1b05443758baf0f1e683893e9a0ba6558a073924) Merge remote-tracking branch 'acoliver/feature/clip-fix' into feature/terminal-images - [`0e123c2`](https://github.com/anomalyco/opentui/commit/0e123c2dd892d1fc1b8dd15fdba744c2e0add33e) Merge branch 'main' into feature/terminal-images - [`fabb670`](https://github.com/anomalyco/opentui/commit/fabb6706d45d012973f881d64f27cad73f1f3e44) Merge origin/main into feature/terminal-images - [`2dbbcca`](https://github.com/anomalyco/opentui/commit/2dbbcca6cdf4fed1e316a0fbac91f7a30f489cdb) Fix renderer image formatting and types - [`f40c04b`](https://github.com/anomalyco/opentui/commit/f40c04b0dad61f6765e0a20172314e2ebdafdc21) Pin Bun to 1.2.2 for CI stability and switch image loading to jimp - [`2e9ca16`](https://github.com/anomalyco/opentui/commit/2e9ca164221b166b9c49b691f34d5b2028601019) Use latest Bun with serial test concurrency for CI ### 📊 Changes **20 files changed** (+486 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/build-core.yml` (+4 -0) 📝 `.github/workflows/build-solid.yml` (+6 -0) 📝 `bun.lock` (+15 -1) ➕ `packages/core/src/graphics/protocol.ts` (+41 -0) ➕ `packages/core/src/renderables/Image.ts` (+54 -0) 📝 `packages/core/src/renderables/index.ts` (+1 -0) 📝 `packages/core/src/renderer.ts` (+210 -5) 📝 `packages/core/src/testing/test-recorder.ts` (+3 -3) ➕ `packages/core/src/tests/graphics.protocol.test.ts` (+58 -0) 📝 `packages/core/src/tests/renderer.control.test.ts` (+2 -2) ➕ `packages/core/src/tests/renderer.images.test.ts` (+70 -0) 📝 `packages/core/src/types.ts` (+3 -0) 📝 `packages/react/jsx-namespace.d.ts` (+2 -0) 📝 `packages/react/src/components/index.ts` (+2 -0) 📝 `packages/react/src/types/components.ts` (+4 -0) 📝 `packages/solid/jsx-runtime.d.ts` (+2 -0) 📝 `packages/solid/src/elements/hooks.ts` (+1 -1) 📝 `packages/solid/src/elements/index.ts` (+2 -0) 📝 `packages/solid/src/reconciler.ts` (+2 -1) 📝 `packages/solid/src/types/elements.ts` (+4 -0) </details> ### 📄 Description Add experimental terminal image rendering support with pixel sizing and React exposure. Highlights: - New Image renderable that accepts pixelWidth/pixelHeight and fit modes (contain/cover/fill) with sharp-based scaling. - Renderer loads/caches images, emits kitty/iTerm2 graphics escapes, deletes kitty ids on move/resize, and surfaces pixelResolution via capabilities and a pixelResolution event. - React type exports and components include Image; tests cover graphics protocol parsing and renderer image path. Notes: - Native build/tests not run here; JS tests only. - Pixel resolution query/response handled in JS; header sizing in downstream apps should use the exposed resolution and avoid hardcoded px-per-cell fallbacks. Addresses #387 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#503
No description provided.