Cotal TypeScript packages
    Preparing search index...

    Interface TerminalTransport

    A transport-agnostic terminal session. attachClient drives the terminal through this interface, so the SAME raw-mode / alt-screen / detach handling serves the mesh §13.6 session (meshSessionTransport). (The legacy loopback ws://.../attach/ transport was removed with the P2 item 6 no-127.0.0.1 sweep.)

    interface TerminalTransport {
        close(): void;
        onData(cb: (bytes: Buffer) => void | Promise<void>): void;
        onEnd(cb: (err?: Error, reason?: string) => void): void;
        onReady(cb: () => void): void;
        resize(cols: number, rows: number): void;
        send(bytes: Buffer): void;
    }
    Index
    • Remote → local: terminal output bytes. The transport awaits an async consumer before returning credit, so a slow local stdout applies real backpressure instead of acknowledging unread bytes.

      Parameters

      • cb: (bytes: Buffer) => void | Promise<void>

      Returns void

    • The session ended: err on a transport error (rejects), else a clean detach/close (resolves), with the peer's distinct end reason when it sent one.

      Parameters

      • cb: (err?: Error, reason?: string) => void

      Returns void