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
resize_terminal gRPC endpoint. Resizes the PTY backing a terminal so the shell receives SIGWINCH and readline/shells repaint correctly. Also emits sky://terminal/resize so the Sky xterm.js panel reflows its viewport to match.
TerminalInput
Forward bytes received from Cocoon to the PTY master writer.