Skip to content

Expose lines leaving the terminal viewport - #158

Open
simonefil wants to merge 1 commit into
tomlm:mainfrom
simonefil:main
Open

simonefil wants to merge 1 commit into
tomlm:mainfrom
simonefil:main

Conversation

@simonefil

Copy link
Copy Markdown

Motivation

Headless terminal hosts may need to persist or process rows as they leave the active viewport. One example is maintaining an external, bounded history that survives beyond
XTerm.NET's in-memory scrollback.

The existing Scrolled, Trimmed, and BufferChanged events do not provide the affected BufferLine before it is moved, removed, or recycled. A host therefore cannot reliably
capture the final contents and attributes of that row.

Changes

This adds a LineExitedViewport event to Terminal. The event reports:

  • the BufferLine leaving the viewport;
  • whether it belongs to the normal or alternate buffer;
  • whether it exited because of scrolling or buffer deactivation.

Scroll notifications are raised synchronously before the line can be spliced or recycled. Full-width scroll regions are supported; narrowed left/right margins do not raise the
event because they move only part of each row.

When switching buffers, the event is raised for meaningful visible rows before the previous buffer is deactivated. Trailing empty rows are omitted.

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.

1 participant