Table of Contents
I get many requests for utf8 support. As of the time I write this, epic does not support utf8, and support for it is not planned in the short term. This document describes how epic handles your keypresses, and discusses how utf8 support might grow in the future. This document is not intended to be excruciatingly exacting enough to satisfy pedants, but rather to gently introduce people to the issues and why console programs have a much harder time of it than graphical program.s
How epic handles user input
The flow chart
1) You press a key 2) Your terminal emulator converts it to a string 3) That string is sent to epic 4) EPIC decomposes the string into individual characters 5) Sequences of characters are accumulated to match your bindings. 6) The actions associated with your bindings are executed.
Your terminal emulator and epic must agree
If your terminal emulator sends ^ your emulator can send whatever string it wants, and epic would not have any idea what that is. However, there is historical precedent that certain keys generate certain strings, and most terminal emulators use them for maximum compatability. So you usually never have to think about this. It Just Works(tm). =====EPIC receives the string===== Whatever string your terminal emulator sent is received by epic as user input. EPIC has to convert this string of bytes into a sequence of //characters//, which then are grouped together to form //character sequences// which are associated with a //key binding//, which performs an //action//. =====Keybindings regroup strings back into key presses===== Since pressing some keys generates multiple bytes of input, you have to tell epic how to re-assemble those bytes of input back into one logical character. This is done through keybindings. In our current example, you did /bind ^[[D backward_character. What this does is tell epic to treat the character sequence ^[[D as one keypress and you want it to execute the [[backward_characte action when you do that keypress. If you didn't have the keybinding, then epic would treat each of the three keys as individual keypresses, and do whatever action each of the three were bound to!