|
| 1 | +# Configuration and User Preferences |
| 2 | + |
| 3 | +Terminal::Widgets has two main ways to set config and user prefs: |
| 4 | + |
| 5 | +* Environment variables |
| 6 | +* Terminal instance attributes |
| 7 | + |
| 8 | + |
| 9 | +## Environment Variables |
| 10 | + |
| 11 | +All Terminal::Widgets-specific environment variables use a `TW_` prefix; the |
| 12 | +remaining environment variables are general standards that Terminal::Widgets |
| 13 | +respects. |
| 14 | + |
| 15 | + |
| 16 | +### `LANGUAGE` or `LANG` |
| 17 | + |
| 18 | +Used by `Terminal::Widgets::I18N::Translation::LanguageSelection` to detect |
| 19 | +user's preference for translation languages. If both are set, `LANGUAGE` is |
| 20 | +preferred over `LANG`. |
| 21 | + |
| 22 | + |
| 23 | +### `TERM`, `TERM_PROGRAM`, `COLORTERM`, and others |
| 24 | + |
| 25 | +Used to detect the user's terminal emulator -- and terminal multiplexer if any |
| 26 | +-- which helps to determine available terminal capabilities. See |
| 27 | +Terminal::Capabilities::Autodetect for recognized terminals and capabilities. |
| 28 | + |
| 29 | + |
| 30 | +### `TW_DEBUG=<debug verbosity level>` |
| 31 | + |
| 32 | +If >0, turn on Terminal::Widgets debugging (sent to the standard error stream). |
| 33 | +Level 1 will enable the most basic debugging and timing info; higher levels |
| 34 | +will enable successively more debug output. Notably level 2 will turn on |
| 35 | +debug views of every composited widget grid, and level 3 will turn on Backtrace |
| 36 | +info. |
| 37 | + |
| 38 | + |
| 39 | +### `TW_SYMBOLS=<symbol set name>` |
| 40 | + |
| 41 | +Override an autodetected terminal symbol set with a different Unicode subset, |
| 42 | +usually because the installed fonts don't support the full autodetected set. |
| 43 | +See the Terminal::Capabilities documentation for available symbol set names. |
| 44 | + |
| 45 | + |
| 46 | +### `TW_VT100_BOXES=<0|1>` |
| 47 | + |
| 48 | +Override autodetection of VT100 box drawing capabilities. This capability is |
| 49 | +very minimal, so is almost universally supported by modern terminal emulators. |
| 50 | +You may still turn this off and set `TW_SYMBOLS=ASCII` in order to test for |
| 51 | +the most absolutely basic terminal support. |
| 52 | + |
| 53 | + |
| 54 | +## Terminal Instance Attributes |
| 55 | + |
| 56 | +When creating a new Terminal::Widgets::Terminal object (either directly with |
| 57 | +`Terminal::Widgets::Terminal.new` or via `Terminal::Widgets::App.add-terminal`), |
| 58 | +you can specify several configuration attributes: |
| 59 | + |
| 60 | + |
| 61 | +### `caps` |
| 62 | + |
| 63 | +A Terminal::Capabilities object describing available functionality in the |
| 64 | +user's terminal emulator and fonts, such as support for 24-bit color or emoji |
| 65 | +skin tones. `App.add-terminal` will attempt to autodetect `caps` if adding the |
| 66 | +processes's controlling terminal (`/dev/tty` on *nix systems). |
| 67 | + |
| 68 | +If desired some of the capabilities can be overridden by environment variables |
| 69 | +such as `TW_SYMBOLS` and `TW_VT100_BOXES`. |
| 70 | + |
| 71 | + |
| 72 | +### `locale` |
| 73 | + |
| 74 | +A Terminal::Widgets::I18N::Locale object describing the user's current locale |
| 75 | +(translation string table, regional formatting rules, etc.). |
| 76 | + |
| 77 | + |
| 78 | +### `ui-prefs` |
| 79 | + |
| 80 | +A Hash of miscellaneous UI preference settings. The following settings are |
| 81 | +currently recognized by Terminal::Widgets: |
| 82 | + |
| 83 | +* `Bool input-activation-flash` - If `True`, flash Input widgets when |
| 84 | + activated, such as when a Button is clicked. Defaults to `False`. |
0 commit comments