ProgramHost.webSocket constructor

ProgramHost.webSocket(
  1. WebSocket socket, {
  2. TerminalDimensions initialSize = (width: 80, height: 24),
  3. bool supportsAnsi = true,
  4. bool isTerminal = true,
  5. ColorProfile colorProfile = ColorProfile.trueColor,
  6. ({bool useBackspace, bool useTabs}) movementCaps = (useTabs: false, useBackspace: true),
  7. bool closeSocketOnDispose = true,
})

Creates a websocket-backed host using the JSON bridge protocol.

Implementation

factory ProgramHost.webSocket(
  io.WebSocket socket, {
  TerminalDimensions initialSize = const (width: 80, height: 24),
  bool supportsAnsi = true,
  bool isTerminal = true,
  ColorProfile colorProfile = ColorProfile.trueColor,
  ({bool useTabs, bool useBackspace}) movementCaps = const (
    useTabs: false,
    useBackspace: true,
  ),
  bool closeSocketOnDispose = true,
}) => _BackendProgramHost(
  WebSocketTerminalBackend(
    socket,
    initialSize: initialSize,
    supportsAnsi: supportsAnsi,
    isTerminal: isTerminal,
    colorProfile: colorProfile,
    movementCaps: movementCaps,
    closeSocketOnDispose: closeSocketOnDispose,
  ),
);