Skip to content

@jsvision/ui / ApplicationOptions

Interface: ApplicationOptions

Defined in: ui/src/app/application.ts:23

Options for createApplication. Everything is optional — an app starts with no arguments.

Properties

adaptAmbiguousWidth?

optional adaptAmbiguousWidth?: boolean

Defined in: ui/src/app/application.ts:69

On a real terminal, automatically switch to ASCII-safe frame chrome if the startup probe finds the ambiguous-width glyphs render double-width. Default true; pass false to skip the probe.


caps?

optional caps?: "auto" | CapabilityProfile

Defined in: ui/src/app/application.ts:29

Terminal capability profile that drives color-depth encoding for every painted frame. Defaults to 'auto', which detects the running terminal's capabilities via resolveCapabilities(). Pass an explicit profile to override the detection (used verbatim, no re-resolution).


clipboardKeys?

optional clipboardKeys?: ClipboardKeys

Defined in: ui/src/app/application.ts:44

Which clipboard key set the framework binds by default (default 'both' — modern Ctrl+A/C/X/V plus the classic Ctrl+Insert/Shift+Insert/Shift+Delete aliases). Any keymap you supply merges on top and wins on a conflicting chord. Use 'none' to bind no clipboard chords (e.g. an app hosting a WordStar-mode Editor) and supply your own keymap instead.


input?

optional input?: ReadStream

Defined in: ui/src/app/application.ts:57

Input stream to read from; defaults to process.stdin. Inject a fake TTY stream to run headlessly.


keymap?

optional keymap?: Keymap

Defined in: ui/src/app/application.ts:37

Key-chord → command map (from core's createKeymap) applied across the whole app.


logger?

optional logger?: Logger

Defined in: ui/src/app/application.ts:35

Logger that receives errors thrown from a view's draw()/onEvent(); defaults to a no-op logger.


optional menuBar?: MenuBar

Defined in: ui/src/app/application.ts:46

Optional menu bar shown as the top row. Build one with menuBar(...).


output?

optional output?: WriteStream

Defined in: ui/src/app/application.ts:59

Output stream to write to; defaults to process.stdout.


requireTty?

optional requireTty?: boolean

Defined in: ui/src/app/application.ts:83

Require an interactive TTY at startup. When true (the default), run() asserts the terminal essentials before taking over the screen and throws EssentialsNotMetError when there is no interactive terminal at all — a cron/CI job, a container with no tty, or stdin and stdout both redirected with no controlling terminal — instead of silently starting a keyboard-less app. (Piping output while a controlling terminal exists still works: the host binds /dev/tty.) Set false for headless/automated runs that drive the loop without a real terminal.

Example

ts
// A headless integration test drives run() without a terminal:
const app = createApplication({ caps, requireTty: false });
const exit = app.run(); // starts against injected streams; no EssentialsNotMetError

revealKey?

optional revealKey?: string | null

Defined in: ui/src/app/application.ts:53

The key that toggles accelerator mode (default 'f12'): while on, every ~X~ hotkey is underlined and a bare letter fires the matching accelerator. Pass null to disable the feature.


runtime?

optional runtime?: RuntimeAdapter

Defined in: ui/src/app/application.ts:55

OS boundary the host runs against; defaults to the real Node runtime. Inject a fake in tests.


statusLine?

optional statusLine?: StatusLine

Defined in: ui/src/app/application.ts:48

Optional status line shown as the bottom row. Build one with statusLine(...).


theme?

optional theme?: Theme

Defined in: ui/src/app/application.ts:33

Color/style theme applied to every view; defaults to the built-in defaultTheme.


viewport?

optional viewport?: Size2D

Defined in: ui/src/app/application.ts:31

Initial viewport size in cells. Defaults to the output terminal's size, or 80×24 if unknown.


warnAmbiguousWidth?

optional warnAmbiguousWidth?: boolean

Defined in: ui/src/app/application.ts:64

On a real terminal, warn once at startup if the terminal renders the ambiguous-width frame glyphs double-width (which shifts alignment). Default true; pass false to skip the probe in tests.