withPlainMode function

ProgramOption withPlainMode([
  1. bool on = true
])

Forces plain mode on or off for this program.

In plain mode the one-shot helpers (promptSelect, promptConfirm, promptInput, filter, spin, pager and Form.run) ask plain line questions and write no escape codes, for pipes, CI, screen readers and AI agents. Without this option plain mode is on when DART_TUI_ACCESSIBLE or ACCESSIBLE is set (see withEnvironment), or when the helper uses the real stdin and stdout and either is not a terminal, or TERM=dumb. A forced false wins over all of these.

A custom Program in plain mode renders nothing while it runs and writes its final frame as plain text once on exit.

Implementation

ProgramOption withPlainMode([bool on = true]) => (p) => p._plain = on;