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

VariableTypeDefaultDescription
OTUI_TS_STYLE_WARNstringfalseEnable warnings for missing syntax styles
OTUI_TREE_SITTER_WORKER_PATHstring""Path to the Tree-sitter worker
XDG_CONFIG_HOMEstring""Base directory for user-specific configuration files
XDG_DATA_HOMEstring""Base directory for user-specific data files
OTUI_DEBUG_FFIbooleanfalseEnable debug logging for the FFI bindings
OTUI_SHOW_STATSbooleanfalseShow the debug overlay at startup
OTUI_TRACE_FFIbooleanfalseEnable tracing for the FFI bindings
OPENTUI_FORCE_WCWIDTHbooleanfalseUse wcwidth for character width calculations
OPENTUI_FORCE_UNICODEbooleanfalseForce Mode 2026 Unicode support in terminal capabilities
OPENTUI_GRAPHICSbooleantrueEnable Kitty graphics protocol detection
OPENTUI_FORCE_NOZWJbooleanfalseUse no_zwj width method (Unicode without ZWJ joining)
OPENTUI_FORCE_EXPLICIT_WIDTHstring-Force explicit width detection (true/1 or false/0)
OTUI_USE_CONSOLEbooleantrueEnable global console.* capture for the built-in overlay
SHOW_CONSOLEbooleanfalseOpen the built-in console overlay at startup
OTUI_DUMP_CAPTURESbooleanfalseDump captured stdout and console caches from the exit handler
OTUI_NO_NATIVE_RENDERbooleanfalseSkip the Zig/native frame renderer
OTUI_DEBUGbooleanfalseCapture all raw stdin input for debugging

Notes

  • OPENTUI_FORCE_EXPLICIT_WIDTH=false skips OSC 66 queries on older terminals.
  • Disable global console.* capture with OTUI_USE_CONSOLE=false. consoleMode only changes the overlay surface.
  • OTUI_NO_NATIVE_RENDER still runs the render loop. In "split-footer" mode, the current stdout flush path can still emit ANSI cursor movement and clear sequences.
  • OTUI_DUMP_CAPTURES runs from the renderer exit handler. A direct renderer.destroy() call does not trigger it by itself.