tui.start
tui.start FILE
Runs a markup-driven app: validates the page, initializes the terminal, loads FILE and runs the main loop until the app quits.
Parameters
FILE: the first page (XML).
Returns: 1 when FILE is unreadable, fails validation or fails to load; otherwise returns after the app quits.
Notes
- Validates
FILEand its includes before the terminal is taken over. Errors are printed to stderr and abort the start, unlessTUI_IGNORE_INVALID_XML=1(set bydabt --ignore-invalid-xml).TUI_VALIDATE=0skips validation. - Sets
TUI_THEMES_DIRto the page’sthemes/folder (else the defaults’themes/) when it is not already set. - The terminal is restored on every exit path: normal quit,
INT/TERM, or a load failure. - Uses the page cache for later
tui.gotocalls but does not pre-warm it; seetui.start_cached.
Example
#!/usr/bin/env bash
TUI_APP_NAME=my_app # before sourcing: names the config folder and log file
source /path/to/lib/tui.sh
tui.start "$APP/config/home.xml"
See also: tui.start_cached, tui.init, tui.run
