Documentation Index
Fetch the complete documentation index at: https://docs.declaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
sbx.PTY is the *PTY sub-object available on every Sandbox instance. It provides methods to create interactive terminal sessions, send input, resize, stream output, and kill sessions.
sbx.PTY.Create()
Create a new PTY session. The sandbox spawns an interactive shell and returns a *PtyHandle.
PtySize is provided, the default 80x24 is used:
Initial terminal dimensions (optional variadic argument).
(*PtyHandle, error)
PtyHandle
PtyHandle is returned by PTY.Create(). It exposes the full session lifecycle.
handle.PID
Type int — the process ID of the shell process backing the PTY.
handle.SendInput()
Forward keystrokes or text to the shell.
Raw bytes to send to the PTY stdin.
error
handle.SetSize()
Change the remote terminal dimensions. Fires SIGWINCH inside so ncurses apps redraw.
Number of columns.
Number of rows.
error
handle.Stream()
Returns a read-only channel that receives output data from the PTY as []byte chunks. The channel is closed when the PTY session ends or the context is canceled.
(<-chan []byte, error)
handle.Kill()
Terminate the PTY session (SIGKILL to the process group).
error