mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-24 20:45:56 +03:00
[PR #574] [MERGED] add captureSpans and getSpanLines for styled terminal output capture #628
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#628
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/574
Author: @remorses
Created: 1/23/2026
Status: ✅ Merged
Merged: 1/25/2026
Merged by: @kommander
Base:
main← Head:capture-spans-upstream📝 Commits (7)
b35b422add captureSpans and getSpanLines for styled terminal output captured280a03remove unused VTermData importb340c0fformat3d253berefactor: use RGBA class and rgbToHex from lib instead of inline function1dd866crefactor: use existing types instead of VTerm types, add RGBA.equals()1136691style: format31303e0Merge branch 'main' into capture-spans-upstream📊 Changes
5 files changed (+237 additions, -1 deletions)
View changed files
📝
packages/core/src/buffer.ts(+53 -1)📝
packages/core/src/lib/RGBA.ts(+5 -0)➕
packages/core/src/testing/capture-spans.test.ts(+147 -0)📝
packages/core/src/testing/test-renderer.ts(+13 -0)📝
packages/core/src/types.ts(+19 -0)📄 Description
Uses the same VTerm data structures from #440 to expose terminal buffer content as structured span data.
Adds
getSpanLines()toOptimizedBufferandcaptureSpans()to test renderer.Use case: render opentui output to web pages or images. You can render a TUI in a test renderer, extract the spans, and serialize them for web rendering or image generation.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.