Skip to content

add bounded copied terminal snapshots - #673

Draft
sirfergy wants to merge 12 commits into
migueldeicaza:mainfrom
sirfergy:sirfergy/terminal-embedding-apis
Draft

add bounded copied terminal snapshots#673
sirfergy wants to merge 12 commits into
migueldeicaza:mainfrom
sirfergy:sirfergy/terminal-embedding-apis

Conversation

@sirfergy

@sirfergy sirfergy commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

SwiftTerm keeps a view's mutable terminal private, but embedders still need input modes and a bounded copy of the viewport or history. Expose copied values captured under one terminal-lock transaction, so hosts can inspect them without retaining live terminal storage.

The snapshot remains valid after later feeds, resizes, and history trimming. Callers choose the history limit; row coordinates retain the terminal's scroll-invariant numbering.

Tests

Covers copied-value lifetime, input modes, bounded history, complete grapheme text, row coordinates, and checked Sendable values.

Related

Previously bundled work is now proposed independently:

Existing commits are preserved; the final diff contains only copied snapshots.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

obvioussean and others added 5 commits August 31, 2026 11:03
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Probe sibling SwiftTerm resource bundles only for xctest bundles, including tests loaded by a separate SwiftPM runner. Keep application resource discovery and the nontrapping Bundle.module avoidance unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 7e815dc)
Keep copied DTO construction internal and derive row text lazily from full cell values with BufferLine-equivalent trimming.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
obvioussean and others added 4 commits September 1, 2026 17:22
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the Objective-C autorelease pool on Apple platforms and run the same scoped lifecycle assertions directly on Linux. Import Darwin explicitly in the macOS callback teardown tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep immutable line identity tokens alive in paragraph keys so allocator reuse cannot turn a cached LTR paragraph into an RTL cache hit. Do not retain mutable terminal buffers or repeat token hashing on the cache fast path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@migueldeicaza

Copy link
Copy Markdown
Owner

The core idea is sound, but this PR contains a bunch of unrelated things, which we should review independently.

obvioussean and others added 2 commits September 2, 2026 09:43
Keep this proposal focused on copied terminal state. The extracted changes are being proposed independently; the downstream release remains pinned to the existing combined fork revision.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants