[FEATURE] Resize the primary PTY through its original session owner #4

Open
opened 2026-10-24 02:45:28 +02:00 by erikinkinen · 2 comments
Owner

Problem and motivation

Native pagers need to observe changes to their original PTY dimensions. Ttyd already has typed resize requests and transactional PTY resize state, but its session-lifecycle IPC adapter does not dispatch that request.

Proposed behavior and scope

Accept TtyResizeRequestV1 only through the authenticated session owner's lifecycle endpoint. Resize that session's live primary PTY and return an empty typed success or retry reply. Identical dimensions remain a no-op; successive pending resize events retain the latest generation. Coordinate the original owner and physical-page fixture in Integration.

Authority, security and reliability

The receiving endpoint selects the original generational session. Request bodies cannot name a session, PTY or capability. Inherited stdin/stdout endpoints remain unable to resize; man retains state-read access and its exact manual-store READ only. Validate framing, dimensions, correlation and reply capacity before effects. Preserve event-queue backpressure, stale-session refusal and unwanted-receipt cleanup.

Acceptance criteria

  • Add the typed owner-only adapter without expanding inherited stream operations.
  • Cover shrink/grow, identical sizes, event coalescing, full queues, malformed requests, stale sessions and reply shortage.
  • Cover unwanted receipt retirement and independent stream-route refusal.
  • Document the caller/receiver contract.
  • Select matching Integration suppliers.
  • Exercise the selected owner/reader scenario on a matching image; host controls alone do not establish guest acceptance.

Alternatives and tradeoffs

Changing a host display does not prove guest PTY state changed. The existing lifecycle owner can issue the typed operation without delegating resize control to the reader or introducing another discovery route.

Tracking and rollout

Related terminal work: #1. The Integration fixture must retain actual owner calls, fresh state and physical screen rows before claiming resize acceptance.

## Problem and motivation Native pagers need to observe changes to their original PTY dimensions. Ttyd already has typed resize requests and transactional PTY resize state, but its session-lifecycle IPC adapter does not dispatch that request. ## Proposed behavior and scope Accept `TtyResizeRequestV1` only through the authenticated session owner's lifecycle endpoint. Resize that session's live primary PTY and return an empty typed success or retry reply. Identical dimensions remain a no-op; successive pending resize events retain the latest generation. Coordinate the original owner and physical-page fixture in Integration. ## Authority, security and reliability The receiving endpoint selects the original generational session. Request bodies cannot name a session, PTY or capability. Inherited stdin/stdout endpoints remain unable to resize; `man` retains state-read access and its exact manual-store READ only. Validate framing, dimensions, correlation and reply capacity before effects. Preserve event-queue backpressure, stale-session refusal and unwanted-receipt cleanup. ## Acceptance criteria - [x] Add the typed owner-only adapter without expanding inherited stream operations. - [x] Cover shrink/grow, identical sizes, event coalescing, full queues, malformed requests, stale sessions and reply shortage. - [x] Cover unwanted receipt retirement and independent stream-route refusal. - [x] Document the caller/receiver contract. - [x] Select matching Integration suppliers. - [ ] Exercise the selected owner/reader scenario on a matching image; host controls alone do not establish guest acceptance. ## Alternatives and tradeoffs Changing a host display does not prove guest PTY state changed. The existing lifecycle owner can issue the typed operation without delegating resize control to the reader or introducing another discovery route. ## Tracking and rollout Related terminal work: #1. The Integration fixture must retain actual owner calls, fresh state and physical screen rows before claiming resize acceptance.
Author
Owner

Implemented in 77a106c. The original session owner can resize its primary PTY; inherited stream routes still refuse control. All 161 library tests passed in both default and runtime configurations, including the new resize and receipt-cleanup controls. Matching-image owner calls and physical screen observations remain open.

Implemented in [77a106c](https://git.erikinkinen.fi/erix/ttyd/commit/77a106cac0519da8407b61dc32624d1d60c686e4). The original session owner can resize its primary PTY; inherited stream routes still refuse control. All 161 library tests passed in both default and runtime configurations, including the new resize and receipt-cleanup controls. Matching-image owner calls and physical screen observations remain open.
Author
Owner

Wired in Integration 9c90cdf6 and Rootd 6d7e3ad2. Rootd retains the original lifecycle endpoint and coordinates the two resize checkpoints using sourced input events. The pager keeps state-read access and its exact manual-store READ; it receives no resize authority. Matching-image owner and screen acceptance remains open.

Wired in [Integration 9c90cdf6](https://git.erikinkinen.fi/erix/integration/commit/9c90cdf64d274c95c00d5168400f765b2fbb9b3c) and [Rootd 6d7e3ad2](https://git.erikinkinen.fi/erix/rootd/commit/6d7e3ad2ca9635871a3e1c14fd0eea315658dc4c). Rootd retains the original lifecycle endpoint and coordinates the two resize checkpoints using sourced input events. The pager keeps state-read access and its exact manual-store READ; it receives no resize authority. Matching-image owner and screen acceptance remains open.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:35:15 +01: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
erix/ttyd#4
No description provided.