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
10 changes: 10 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ After the previous stream closes, a prepared
replies when it starts, pumps once, or sends data. It queues pending
replies before new input.

#### Close Linux PTY groups after the leader exits (#163)

On Linux with group pidfd signaling, closing
{class}`~libvt.aio.PtySession` signals surviving group members after
the direct child exits. When the pidfd handoff is unavailable, close
signals the group while the direct child runs.

{attr}`~libvt.aio.PtySession.closed_before_eof` records whether close
began before the terminal reached EOF.

### Documentation

#### Assert effective colors alongside screen goldens (#190)
Expand Down
8 changes: 8 additions & 0 deletions MIGRATION
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ Concurrent close can interrupt a pending `drain()` with
queued writes should flush. For a PTY, pass `write_high_water=0` to
{func}`~libvt.aio.open_pty` to drain its entire outbound queue.

### PTY process exit and terminal EOF (#89)

Keep the session open until terminal EOF when capturing the last output
from a worker after the direct child exits. Use
`await session.wait_for(lambda _: session.eof, timeout=3)` before leaving
the context. Read `session.closed_before_eof` to tell whether teardown
began while the PTY was still open.

## libvt 0.0.1a2 (2026-11-28)

### Curated PEP 562 `libvt` root exports (#43)
Expand Down
19 changes: 15 additions & 4 deletions docs/topics/sync-and-asyncio.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,21 @@ read. Input still buffered in the `StreamReader` belongs to the caller.
Leaving `async with` or calling
{meth}`AsyncTerminalStream.aclose() <libvt.aio.AsyncTerminalStream.aclose>` /
{meth}`PtySession.aclose() <libvt.aio.PtySession.aclose>` expires any active
`?2026` hold. `PtySession.aclose()` signals the child process group (`SIGHUP`,
`SIGTERM`, then `SIGKILL`), drains remaining non-blocking output from the
master descriptor, closes it, and calls
{meth}`~libvt.terminal.Terminal.notify_process_exit`.
`?2026` hold. `PtySession.aclose()` signals the owned process group with
`SIGHUP`, then `SIGTERM` and `SIGKILL` if it still exists. It reads any
ready output, closes the master, and calls
{meth}`~libvt.terminal.Terminal.notify_process_exit`. With group pidfd
signaling available (introduced in Linux 6.9), close can signal the original
process group after the direct child exits. On other POSIX systems, or
when the Linux pidfd handoff is unavailable, close signals the group only
while the direct child runs. A surviving worker can receive a write error
when close releases the master.

A remaining worker can keep the PTY open after `session.process.wait()`
returns. To collect the worker's final output, keep the context open and
await `session.wait_for(lambda _: session.eof, timeout=3)`. The
{attr}`~libvt.aio.PtySession.closed_before_eof` flag records whether close
began before the master reported EOF.

Concurrent close calls on either transport wait for the same cleanup.
Wait for close to finish before restarting a stream. A failed stream
Expand Down
Loading
Loading