Surface.fromStdio constructor

Surface.fromStdio(
  1. [Stdout? stdout,
  2. Stdin? stdin]
)

Creates a new terminal that uses stdout and stdin for I/O.

If stdout or stdin are not provided, they default to io.stdout and io.stdin respectively. Upon creation, the terminal will switch to the alternate screen buffer, hide the cursor, and enable raw mode.

When close is called, the terminal will switch back.

Implementation

factory Surface.fromStdio([io.Stdout? stdout, io.Stdin? stdin]) {
  return _StdioSurface(stdout ?? io.stdout, stdin ?? io.stdin);
}