Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@
_Notes on the upcoming release will go here._
<!-- END PLACEHOLDER - ADD NEW CHANGELOG ENTRIES BELOW THIS LINE -->

### What's new

#### Recorder protocol, target protocol, and state replacement (#203)

Pass any {class}`~libvt.terminal.TerminalRecorder` implementation to
{class}`~libvt.terminal.Terminal` to observe normalized input spans and
external resizes without monkey-patching. Call
{meth}`~libvt.terminal.Terminal.replace_from` to replace emulated screen, mode,
and parser state in place while preserving host callbacks, theme settings, and
sync identity.

Implement {class}`~libvt.testing.SupportsVtTarget` (`__vt_target__`) on custom
wrappers passed to {func}`~libvt.testing.vt_screen` and
{func}`~libvt.testing.serialize_vt_snapshot`.
{class}`~libvt.aio.AsyncTerminalStream`, {class}`~libvt.aio.PtySession`, and
{class}`~libvt.contrib.tmux.capture.TmuxCaptureResult` implement this protocol
directly. {func}`~libvt.modes.is_private_mode_supported` exposes profile mode
support queries, and {class}`~libvt.terminal.SnapshotDict` types the dictionary
returned by {meth}`~libvt.terminal.Snapshot.to_dict`.

## libvt 0.0.1a6 (2026-12-05)

`libvt` 0.0.1a6 adds soft-wrapped logical-line reading and `wait_for()`
Expand Down
2 changes: 2 additions & 0 deletions docs/api/aio.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
```{eval-rst}
.. automodule:: libvt.aio
:members:
:inherited-members:
:no-show-inheritance:
:no-private-members:

.. py:type:: TtyMode
Expand Down
4 changes: 2 additions & 2 deletions docs/api/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ immutable {class}`~libvt.terminal.Snapshot` objects, inline

.. py:type:: VtTarget
:module: libvt.testing
:canonical: Terminal | Snapshot | Screen | RegionView | TmuxCaptureResult
:canonical: Terminal | Snapshot | Screen | RegionView | SupportsVtTarget

Terminal, snapshot, screen, region slice, ``tmux`` capture result, or duck-typed pane wrapper (``.terminal``, ``.snapshot()``, or ``.capture_vt()``) accepted by :func:`~libvt.testing.vt_screen` and :func:`~libvt.testing.serialize_vt_snapshot`.
Terminal, snapshot, screen, region slice, :class:`~libvt.testing.SupportsVtTarget` provider (such as :class:`~libvt.contrib.tmux.capture.TmuxCaptureResult`, :class:`~libvt.aio.AsyncTerminalStream`, or :class:`~libvt.aio.PtySession`), or pane wrapper exposing ``.terminal``, ``.snapshot``, or ``.capture_vt()`` accepted by :func:`~libvt.testing.vt_screen` and :func:`~libvt.testing.serialize_vt_snapshot`.
```
10 changes: 6 additions & 4 deletions src/libvt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@
from libvt.config import Limits, Policy, Profile
from libvt.events import Event
from libvt.exc import LibVtError, ProtocolError
from libvt.screen import Cell, Screen
from libvt.screen import Screen
from libvt.snapshot import Snapshot
from libvt.style import Appearance, Style
from libvt.terminal import Snapshot, Terminal, render, strip
from libvt.terminal import Terminal, render, strip
from libvt.views import Cell

_LAZY_EXPORTS: dict[str, tuple[str, str]] = {
"Appearance": ("libvt.style", "Appearance"),
"Cell": ("libvt.screen", "Cell"),
"Cell": ("libvt.views", "Cell"),
"Event": ("libvt.events", "Event"),
"LibVtError": ("libvt.exc", "LibVtError"),
"Limits": ("libvt.config", "Limits"),
"Policy": ("libvt.config", "Policy"),
"Profile": ("libvt.config", "Profile"),
"ProtocolError": ("libvt.exc", "ProtocolError"),
"Screen": ("libvt.screen", "Screen"),
"Snapshot": ("libvt.terminal", "Snapshot"),
"Snapshot": ("libvt.snapshot", "Snapshot"),
"Style": ("libvt.style", "Style"),
"Terminal": ("libvt.terminal", "Terminal"),
"render": ("libvt.terminal", "render"),
Expand Down
Loading
Loading