Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Console terminal events

Platform spec feature

Console terminal events

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

What this feature specifies

How the corelib observes terminal size changes and notifies UI code: Platform.Terminal.QuerySize, PollResizeChannel<ConsoleMessage>, and same-fiber OnResize event hubs. No new runtime builtins—only existing environment, ioctl externs, and fiber/channel primitives.

Contract statement

  • Console.ConsoleSize uses character cells (columns, rows as i32).
  • QuerySize must try platform Winsize (Linux, macOS, Windows) then fall back to COLUMNS / LINES parsing.
  • PollResize must Send ConsoleMessage::Resize(now) only when dimensions change.
  • SubscribeOnResize must invoke the handler synchronously once with the current size after subscription.
  • Resize delivery must not use a separate OS-thread callback API in v1.

Implementation anchors

  • compiler/corelib/packages/console/src/Platform/Terminal.bd
  • compiler/corelib/packages/console/src/Console.bd
  • compiler/corelib/packages/console/src/Console/ConsoleMessage.bd
  • Tests: ConsoleMessageChannelTests.bd

No open decisions. Closed choices are normative ADRs under adr/ (D-CORE-TERM-0050D-CORE-TERM-0052); use the reader ADRs tab for expandable detail.

Articles