Skip to main content

Module session

Module session 

Source
Expand description

Session manager — owns and manages active shell sessions.

SessionManager is the core lifecycle engine for interactive PTY sessions. It provides thread-safe creation, I/O, and cleanup of ShellSessions, each backed by a PtyHandle and a ReadinessDetector.

Design invariants:

  • The Mutex is held only for HashMap insert/remove — never during I/O.
  • Sessions are removed from the map before I/O and reinserted after, so the lock is never contended by blocking reads/writes.
  • ANSI escape sequences are stripped from all output before returning.

Structs§

SendResult
Result of sending input to a session.
SessionManager
Thread-safe manager for all active shell sessions.
SessionOpts
Options for creating a new session.
ShellSessionInfo
Snapshot of session metadata (no mutable borrows needed).

Enums§

SessionStatus
Lifecycle status of a session.

Functions§

start_reaper
Spawn a background task that periodically reaps idle sessions.