server/backend_pty_manager.ts

Declarations
#

5 declarations

view source

FallbackPtyProcess
#

server/backend_pty_manager.ts view source

FallbackPtyProcess

Fallback PTY process — Deno.Command with piped stdin/stdout/stderr.

kind

type 'fallback'

process

type Deno.ChildProcess

terminal_id

type Uuid

command

type string

args

type Array<string>

stdin_writer

type WritableStreamDefaultWriter<Uint8Array>

FfiPtyProcess
#

server/backend_pty_manager.ts view source

FfiPtyProcess

FFI-backed PTY process — real terminal via forkpty.

kind

type 'ffi'

pid

type number

master_fd

type number

terminal_id

type Uuid

command

type string

args

type Array<string>

reading

type boolean

PtyManager
#

server/backend_pty_manager.ts view source

Manages spawned PTY processes keyed by terminal_id. Uses real PTY via FFI when available, falls back to Deno.Command pipes.

log

type Logger | null

readonly

use_ffi

type boolean

readonly

constructor

type new (options: PtyManagerOptions): PtyManager

options

spawn

Spawn a new PTY process and begin streaming its output.

type (terminal_id: string & $brand<"Uuid">, command: string, args: string[], cwd?: string | undefined, cols?: number, rows?: number): void

terminal_id
type string & $brand<"Uuid">
command
type string
args
type string[]
cwd?
type string | undefined
optional
cols
type number
default 80
rows
type number
default 24
returns void

write

Write data to a terminal's stdin.

type (terminal_id: string & $brand<"Uuid">, data: string): Promise<void>

terminal_id
type string & $brand<"Uuid">
data
type string
returns Promise<void>

resize

Resize the PTY window. Only works in FFI mode.

type (terminal_id: string & $brand<"Uuid">, cols: number, rows: number): void

terminal_id
type string & $brand<"Uuid">
cols
type number
rows
type number
returns void

kill

Kill a terminal process.

type (terminal_id: string & $brand<"Uuid">, signal?: string | undefined): Promise<number | null>

terminal_id
type string & $brand<"Uuid">
signal?
type string | undefined
optional
returns Promise<number | null>

has

Check if a terminal exists and is tracked.

type (terminal_id: string & $brand<"Uuid">): boolean

terminal_id
type string & $brand<"Uuid">
returns boolean

destroy

Kill all terminal processes. Called on backend shutdown.

type (): Promise<void>

returns Promise<void>

PtyManagerOptions
#

PtyProcess
#

Depends on
#

Imported by
#