Skip to main content

Module Terminal

Module Terminal 

Source
Expand description

Terminal-domain handlers for CocoonService. Eight entry points cover lifecycle (open/close), I/O (input/data), notifications (opened/closed/ processId), and resize.

Modulesยง

AcceptTerminalClosed
Forward a terminal-closed notification to Sky on sky://terminal/exit. (/closed had no consumer.)
AcceptTerminalOpened
Forward a terminal-opened notification to Sky on sky://terminal/create (NOT /opened - SkyBridge.ts:1736 listens on create and destructures { id, name, pid }; the pid is best-effort 0 here until the real one lands via AcceptTerminalProcessId).
AcceptTerminalProcessData
Forward terminal stdout bytes to Sky on sky://terminal/data as lossy-decoded UTF-8.
AcceptTerminalProcessId
Forward the resolved PID for a terminal to Sky on sky://terminal/processId.
CloseTerminal
Dispose a PTY via TerminalProvider::DisposeTerminal.
OpenTerminal
Spawn a new PTY via TerminalProvider::CreateTerminal. Builds the options JSON TerminalStateDTO::Create expects (name + shellPath + shellArgs + cwd) and forwards through.
ResizeTerminal
Notify Sky/Wind of new terminal dimensions on sky://terminal/resize. TODO(P1): also call portable_pty::MasterPty::resize once the master handle is stored in TerminalStateDTO (requires wrapping in Arc<Mutex>).
TerminalInput
Forward bytes received from Cocoon to the PTY master writer.