Esc

open_session

procedureextensionexperimentalsince 0.36.1Source
  • macOS: open_session works on macOS
  • Linux: open_session works on Linux
  • Windows: open_session works on Windows
  • Wasm: open_session works on Wasm

Starts shell as an interactive shell, or with -c command when command is nonempty. The child inherits the environment with TERM=xterm-256color. Call before starting other threads. Returns false on setup failure. Windows returns unsupported without importing POSIX.

Signature

open_session :: (
    shell: string,
    command: string = "",
    cols: int = 80,
    rows: int = 24
) -> (Session, bool)
Example↗
session, ok := open_session("/bin/sh", "printf hello", 80, 24);
if ok close_session(*session);

See also