Environment variables
OpenTUI reads environment variables at runtime. Bun loads .env automatically, so you can set these in your shell or in a .env file.
Variables
| Variable | Type | Default | Description |
|---|---|---|---|
OTUI_TS_STYLE_WARN | string | false | Enable warnings for missing syntax styles |
OTUI_TREE_SITTER_WORKER_PATH | string | "" | Path to the Tree-sitter worker |
XDG_CONFIG_HOME | string | "" | Base directory for user-specific configuration files |
XDG_DATA_HOME | string | "" | Base directory for user-specific data files |
OTUI_DEBUG_FFI | boolean | false | Enable debug logging for the FFI bindings |
OTUI_SHOW_STATS | boolean | false | Show the debug overlay at startup |
OTUI_TRACE_FFI | boolean | false | Enable tracing for the FFI bindings |
OPENTUI_FORCE_WCWIDTH | boolean | false | Use wcwidth for character width calculations |
OPENTUI_FORCE_UNICODE | boolean | false | Force Mode 2026 Unicode support in terminal capabilities |
OPENTUI_GRAPHICS | boolean | true | Enable Kitty graphics protocol detection |
OPENTUI_FORCE_NOZWJ | boolean | false | Use no_zwj width method (Unicode without ZWJ joining) |
OPENTUI_FORCE_EXPLICIT_WIDTH | string | - | Force explicit width detection (true/1 or false/0) |
OTUI_USE_CONSOLE | boolean | true | Enable global console.* capture for the built-in overlay |
SHOW_CONSOLE | boolean | false | Open the built-in console overlay at startup |
OTUI_DUMP_CAPTURES | boolean | false | Dump captured stdout and console caches from the exit handler |
OTUI_NO_NATIVE_RENDER | boolean | false | Skip the Zig/native frame renderer |
OTUI_DEBUG | boolean | false | Capture all raw stdin input for debugging |
Notes
OPENTUI_FORCE_EXPLICIT_WIDTH=falseskips OSC 66 queries on older terminals.- Disable global
console.*capture withOTUI_USE_CONSOLE=false.consoleModeonly changes the overlay surface. OTUI_NO_NATIVE_RENDERstill runs the render loop. In"split-footer"mode, the current stdout flush path can still emit ANSI cursor movement and clear sequences.OTUI_DUMP_CAPTURESruns from the renderer exit handler. A directrenderer.destroy()call does not trigger it by itself.