Mappings from input bytes to event in the order specified. Later entries take precedence over earlier in the case multiple entries have the same byte string.
Modulevty-6.5Haskell2010
Graphics.Vty.Config
Vty supports a configuration file format and provides a
corresponding VtyUserConfig data type. The VtyUserConfig can be
provided to platform packages' mkVty functions to customize the
application's use of Vty.
Debug
colorMode
Format:
colorMode "<int|FullColor>"
The preferred color mode to use, chosen from the constructors of the ColorMode type. If absent, the backend driver may detect and choose an appropriate color mode. Implementor's note: backend packages should respect this setting when it is present even when their detection indicates that a different color mode should be used.
debugLog
Format:
"debugLog" string
The value of the environment variable VTY_DEBUG_LOG is equivalent
to a debugLog entry at the end of the last config file.
Input Processing
map
Format:
"map" term string key modifier_list
where
key := KEsc | KChar Char | KBS ... (same as Key)
modifier_list := "[" modifier+ "]"
modifier := MShift | MCtrl | MMeta | MAlt
term := "_" | string
E.g., if the contents are
map _ "\ESC[B" KUp []
map _ "\ESC[1;3B" KDown [MAlt]
map "xterm" "\ESC[D" KLeft []
Then the bytes "\ESC[B" will result in the KUp event on all
terminals. The bytes "\ESC[1;3B" will result in the event KDown
with the MAlt modifier on all terminals. The bytes "\ESC[D" will
result in the KLeft event when TERM is xterm.
If a debug log is requested then vty will output the current input
table to the log in the above format. A workflow for using this is
to set VTY_DEBUG_LOG. Run the application. Check the debug log for
incorrect mappings. Add corrected mappings to $HOME/.vty/config.
Unicode Character Width Maps
widthMap
Format:
"widthMap" string string
E.g.,
widthMap "xterm" "/home/user/.vty/xterm_map.dat"
This directive specifies the path to a Unicode character width map (the second argument) that should correspond to the terminal named by first argument. Unicode character width maps can be produced either by running platform packages' width table tools or by calling the library routine buildUnicodeWidthTable. Vty platform packages should use these configuration settings to attempt to load and install the specified width map.
- 3 types
- 12 values
- Packagevty-6.5
- Exports15
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceConfig.hs
A Vty core library configuration. Platform-specific details are not included in the VtyUserConfig.
Constructors
VtyUserConfigconfigDebugLog :: Maybe FilePathDebug information is appended to this file if not Nothing.
configInputMap :: InputMapThe (input byte, output event) pairs extend the internal input table of VTY and the table from terminfo.
See Graphics.Vty.Config module documentation for documentation of the
mapdirective.configTermWidthMaps :: [(String, FilePath)]Terminal width map files.
configAllowCustomUnicodeWidthTables :: Maybe BoolWhether to permit custom Unicode width table loading by
Graphics.Vty.mkVty.Just Falseindicates that table loading should not be performed. Other values permit table loading.If a table load is attempted and fails, information about the failure will be logged to the debug log if the configuration specifies one. If no custom table is loaded (or if a load fails), the built-in character width table will be used.
configPreferredColorMode :: Maybe ColorModePreferred color mode. If set, this should override platform color mode detection.
Instances4Eq, Show, Semigroup, Monoid
Eq VtyUserConfigDefined in vty-6.5 · Graphics.Vty.ConfigShow VtyUserConfigDefined in vty-6.5 · Graphics.Vty.ConfigSemigroup VtyUserConfigDefined in vty-6.5 · Graphics.Vty.ConfigMonoid VtyUserConfigDefined in vty-6.5 · Graphics.Vty.Config
Load a configuration from vtyConfigPath and $VTY_CONFIG_FILE.
If none is found, build a default configuration.
Parse a Vty configuration file.
Lines in config files that fail to parse are ignored. Later entries take precedence over earlier ones.
The result of a configuration change attempt made by addConfigWidthMap.
Constructors
ConfigurationCreatedA new configuration file file was written with the new width table entry.
ConfigurationModifiedAn existing configuration file was modified with the new width table entry.
ConfigurationConflict StringThe attempted width table entry could not be written to the configuration due to a conflict; the argument here is the width table file path for the conflicting entry.
ConfigurationRedundantNo change was made because the existing configuration already contains the specified mapping.
Instances2Eq, Show
Eq ConfigUpdateResultDefined in vty-6.5 · Graphics.Vty.ConfigShow ConfigUpdateResultDefined in vty-6.5 · Graphics.Vty.Config
addConfigWidthMap :: FilePathThe configuration file path of the configuration to modify or create.
-> StringThe
TERMvalue for thewidthMapdirective.-> FilePathThe width table file path for the directive.
-> IO ConfigUpdateResult
Add a widthMap directive to the Vty configuration file at the
specified path.
If the configuration path refers to a configuration that already contains the directive for the specified map and terminal type, the configuration file will not be modified. If the file does not contain the directive, it will be appended to the file.
If the configuration path does not exist, a new configuration file will be created and any directories in the path will also be created.
This returns a ConfigUpdateResult indicating the change to the configuration. This does not handle exceptions raised by file or directory permissions issues.