[PR #572] [CLOSED] add captureSpans and getSpanLines for styled terminal output capture #627

Closed
opened 2026-03-02 23:47:25 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/572
Author: @remorses
Created: 1/23/2026
Status: Closed

Base: mainHead: capture-spans-upstream


📝 Commits (1)

  • b35b422 add captureSpans and getSpanLines for styled terminal output capture

📊 Changes

4 files changed (+265 additions, -1 deletions)

View changed files

📝 packages/core/src/buffer.ts (+75 -1)
packages/core/src/testing/capture-spans.test.ts (+145 -0)
📝 packages/core/src/testing/test-renderer.ts (+15 -0)
📝 packages/core/src/types.ts (+30 -0)

📄 Description

Adds getSpanLines() to OptimizedBuffer and captureSpans() to test renderer for extracting styled terminal content as structured data.

This enables serializing terminal output with colors and text attributes for use cases like web rendering or testing.


🔄 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/572 **Author:** [@remorses](https://github.com/remorses) **Created:** 1/23/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `capture-spans-upstream` --- ### 📝 Commits (1) - [`b35b422`](https://github.com/anomalyco/opentui/commit/b35b422acbc1dd6e1e8b70f39f194e9f3ff0eca5) add captureSpans and getSpanLines for styled terminal output capture ### 📊 Changes **4 files changed** (+265 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/buffer.ts` (+75 -1) ➕ `packages/core/src/testing/capture-spans.test.ts` (+145 -0) 📝 `packages/core/src/testing/test-renderer.ts` (+15 -0) 📝 `packages/core/src/types.ts` (+30 -0) </details> ### 📄 Description Adds `getSpanLines()` to `OptimizedBuffer` and `captureSpans()` to test renderer for extracting styled terminal content as structured data. This enables serializing terminal output with colors and text attributes for use cases like web rendering or testing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:47:25 +03:00
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#627
No description provided.