wijjit.config.DefaultConfig
- class wijjit.config.DefaultConfig[source]
Default configuration values for Wijjit.
These are the framework defaults. Override them by setting app.config values or loading from a config file.
All configuration keys should be UPPERCASE by convention.
- __init__()
Methods
__init__()Attributes
Terminal window title (OSC 0 / "title bar" text).
Shrink over-committed layouts to fit the terminal instead of clipping.
Master debug flag (enables various debug features).
Log all keyboard events to debug log
Log all mouse events to debug log
'default', 'dark', 'light', or custom theme name
Enable Tab/Shift+Tab navigation between focusable elements
Enable mouse event tracking
Enable Ctrl+Z suspend/background support (Linux/Unix only) When enabled, pressing Ctrl+Z will suspend the app to the background and 'fg' command will resume it.
Maximum worker threads for executor (None = auto-detect)
Global focus color override - applies to all focused elements Format: RGB tuple like (0, 255, 255) for cyan, or None to use theme defaults When set, this color is applied to all :focus style fg_color
Force a full-screen repaint every N seconds to evict foreign bytes (0 = disabled).
Park the hardware terminal cursor on the focused text caret.
Hide cursor during application runtime
Use high contrast colors
Log file path (None = no file logging)
Log format string (Python logging format)
'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'
Maximum frames per second (None = unlimited, int = cap FPS)
'button_event', 'all_events', or 'drag'
Default notification duration in seconds
Margin from screen edge (in characters)
Maximum concurrent notifications (older ones are dismissed)
'top_right', 'top_left', 'bottom_right', 'bottom_left'
Spacing between stacked notifications (in lines)
Disable all ANSI colors (respects NO_COLOR env var standard) https://no-color.org/
Key binding to quit application (e.g., 'ctrl+q', 'ctrl+c', 'q')
Reduce or disable animations (for motion sensitivity)
Auto-refresh interval in seconds (None = disabled, used for animations)
Run without claiming ownership of the process terminal.
Minimum time between renders in milliseconds (throttling)
Run synchronous event handlers in thread pool executor
Visualize element bounds (draw rectangles around elements)
Display FPS counter on screen
Path to custom CSS stylesheet file for additional styles
Suppress Wijjit's internal logging configuration When True, Wijjit will NOT configure its own loggers, giving the host application full control over logging.
Automatically reload file templates when they change on disk (for development).
Template directory path for file-based templates loaded with
wijjit.render_template().Path to custom theme file (JSON or CSS format), overrides DEFAULT_THEME
'auto' (detect), 'force' (always use), 'disable' (ASCII only)
Use alternate screen buffer (recommended for full-screen TUIs)
Warn when render time exceeds threshold (milliseconds, None = disabled)
- ENABLE_MOUSE = True
Enable mouse event tracking
- MOUSE_TRACKING_MODE = 'button_event'
‘button_event’, ‘all_events’, or ‘drag’
- Type:
Mouse tracking mode
- ENABLE_FOCUS_NAVIGATION = True
Enable Tab/Shift+Tab navigation between focusable elements
- QUIT_KEY = 'ctrl+q'
Key binding to quit application (e.g., ‘ctrl+q’, ‘ctrl+c’, ‘q’)
- USE_ALTERNATE_SCREEN = True
Use alternate screen buffer (recommended for full-screen TUIs)
- HIDE_CURSOR = True
Hide cursor during application runtime
- HARDWARE_CURSOR = True
Park the hardware terminal cursor on the focused text caret. When the focused element reports a caret cell (TextInput, TextArea, CodeEditor), each frame ends with a cursor-move + show-cursor escape so the real terminal cursor sits (and blinks) on the caret; it is hidden again when no caret is visible. Terminals and screen readers track the hardware cursor, so this improves accessibility over the painted reverse-video caret alone. Works with the default
HIDE_CURSOR=Truestartup state; inline apps are unaffected.
- APP_TITLE: str | None = None
Terminal window title (OSC 0 / “title bar” text). When set, Wijjit emits the title on startup so the terminal tab/window shows it. Most shells reset the title from their prompt hook when the app exits, so no explicit restore is performed.
Noneleaves the terminal title untouched.
- NO_COLOR = False
Disable all ANSI colors (respects NO_COLOR env var standard) https://no-color.org/
Read at import time.
Wijjitre-reads the environment during construction viano_color_from_env(), so settingNO_COLORafter importing wijjit still takes effect.
- FOCUS_COLOR = None
Global focus color override - applies to all focused elements Format: RGB tuple like (0, 255, 255) for cyan, or None to use theme defaults When set, this color is applied to all :focus style fg_color
- DEFAULT_THEME = 'default'
‘default’, ‘dark’, ‘light’, or custom theme name
- Type:
Default theme to use
- THEME_FILE = None
Path to custom theme file (JSON or CSS format), overrides DEFAULT_THEME
- STYLE_FILE = None
Path to custom CSS stylesheet file for additional styles
- UNICODE_SUPPORT = 'auto'
‘auto’ (detect), ‘force’ (always use), ‘disable’ (ASCII only)
- Type:
Unicode support
- AUTO_FIT_LAYOUT = True
Shrink over-committed layouts to fit the terminal instead of clipping. When a container’s children ask for more space than the container has (typically hard-coded
width=/height=values on a terminal smaller than the author’s), children with slack give space back in proportion, floored at the size their content genuinely needs. Set False to restore the pre-0.1.0 behaviour of letting the overflow clip.
- REFRESH_INTERVAL = None
Auto-refresh interval in seconds (None = disabled, used for animations)
- MAX_FPS = None
Maximum frames per second (None = unlimited, int = cap FPS)
- RUN_SYNC_IN_EXECUTOR = False
Run synchronous event handlers in thread pool executor
- EXECUTOR_MAX_WORKERS = None
Maximum worker threads for executor (None = auto-detect)
- RENDER_THROTTLE_MS = 0
Minimum time between renders in milliseconds (throttling)
- FULL_REPAINT_INTERVAL = 0.0
Force a full-screen repaint every N seconds to evict foreign bytes (0 = disabled). Diff rendering only emits changed cells, so anything a third-party library or subprocess writes to the terminal out-of-band lingers until a full redraw. When set, the event loop repaints the whole screen on this cadence so such corruption self-heals. Left disabled by default because a periodic full repaint negates the diff renderer’s bytes-saved advantage; apps that knowingly write to the terminal can instead call
app.request_full_repaint()for a one-shot heal.
- NOTIFICATION_DURATION = 3.0
Default notification duration in seconds
- NOTIFICATION_POSITION = 'top_right'
‘top_right’, ‘top_left’, ‘bottom_right’, ‘bottom_left’
- Type:
Notification position
- NOTIFICATION_SPACING = 1
Spacing between stacked notifications (in lines)
- NOTIFICATION_MARGIN = 2
Margin from screen edge (in characters)
- NOTIFICATION_MAX_STACK = 5
Maximum concurrent notifications (older ones are dismissed)
- LOG_LEVEL = 'WARNING'
‘DEBUG’, ‘INFO’, ‘WARNING’, ‘ERROR’, ‘CRITICAL’
- Type:
Logging level
- LOG_FILE = None
Log file path (None = no file logging)
- LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
Log format string (Python logging format)
- SUPPRESS_INTERNAL_LOGGING_CONFIG = False
Suppress Wijjit’s internal logging configuration When True, Wijjit will NOT configure its own loggers, giving the host application full control over logging. Set this if you have pre-configured logging handlers for the ‘wijjit’ namespace and don’t want Wijjit to override them.
- DEBUG = False
Master debug flag (enables various debug features).
Enabling DEBUG also turns on strict template undefined checking: the renderer uses
jinja2.StrictUndefined, so referencing an undefined template name (e.g. a typo like{{ usename }}) raisesjinja2.UndefinedErrorinstead of silently rendering an empty string. When debugging, guard optional keys withstate.get('k')or the|defaultfilter (e.g.{{ maybe|default('') }}). The production default (DEBUG=False) stays lenient so one missing key cannot crash a running TUI.
- SHOW_FPS = False
Display FPS counter on screen
- SHOW_BOUNDS = False
Visualize element bounds (draw rectangles around elements)
- DEBUG_INPUT_KEYBOARD = False
Log all keyboard events to debug log
- DEBUG_INPUT_MOUSE = False
Log all mouse events to debug log
- WARN_SLOW_RENDER_MS = None
Warn when render time exceeds threshold (milliseconds, None = disabled)
- TEMPLATE_DIR = None
Template directory path for file-based templates loaded with
wijjit.render_template(). When left asNone, Wijjit auto-discovers atemplates/directory next to the module that constructs the app (Flask’s convention).
- TEMPLATE_AUTO_RELOAD = False
Automatically reload file templates when they change on disk (for development). Wired into the Jinja2 environment’s
auto_reload.
- ENABLE_SUSPEND = True
Enable Ctrl+Z suspend/background support (Linux/Unix only) When enabled, pressing Ctrl+Z will suspend the app to the background and ‘fg’ command will resume it. On Windows, this option is ignored.
- REMOTE = False
Run without claiming ownership of the process terminal. When True, the default terminal backend still writes to stdout but does NOT install the process-global SIGTERM/SIGHUP/atexit terminal-restore net or the SIGTSTP suspend handler. Set this when embedding a Wijjit app in a host process that manages the terminal itself. Custom transports (e.g. an SSH backend) express the same intent via
TerminalBackend.owns_terminaland do not need this flag.
- REDUCE_MOTION = False
Reduce or disable animations (for motion sensitivity)
- HIGH_CONTRAST = False
Use high contrast colors