Skip to main content

Crate zyris_terminal

Crate zyris_terminal 

Source
Expand description

The reference implementation of the Zyris terminal capability: a real pseudo-terminal.

zyris_caps::Terminal is the contract — open, read, screen, write, resize, close and exec. This crate is one implementation of it. PtyTerminal spawns a shell behind a PTY with portable-pty, keeps that shell’s output in a per-session ring buffer, and feeds the same bytes to a vt100 screen model — so read returns the stream while screen renders the grid, and neither consumes the other.

use zyris::{Node, NodeKind};
use zyris_caps::TerminalServer;
use zyris_terminal::PtyTerminal;

let _node = Node::builder()
    .name("workstation")
    .kind(NodeKind::Service)
    .capability(TerminalServer(PtyTerminal::rooted("/srv/work")))
    .build()
    .unwrap();

Sessions are capped, and one nobody has touched for ten minutes is swept away: an agent stuck in a loop cannot leave shells running, and neither can a node that lost the wire.

The root is a default, not a jail. It says where a relative path starts and where exec runs; an absolute path still leaves it, because zyris_caps::resolve_under resolves rather than fences. A deployment that needs a fence enforces one above this crate.

Structs§

PtyTerminal