rPw      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv NoneMDwxyz{|}~@wxyz{|}~'wxyz{|}~NoneMcapability evaluator state  Safe-InferredM~Converts an array of ISO-10646 characters (Char type) to an array of Word8 bytes that is the corresponding UTF8 byte sequenceNoneM`Returns the display width of a character. Assumes all characters with unknown widths are 0 width]Returns the display width of a string. Assumes all characters with unknown widths are 0 width Safe-InferredM'The type of exceptions specific to vty.YThese have fully qualified names by default since, IMO, exception handling requires this.&Uncategorized failure specific to vty. Safe-InferredMEvents. if read from  eventChannel; this is the size at the time of the signal. If read from  nextEvent this is the size at the time the event was processed by Vty. Typically these are the same, but if somebody is resizing the terminal quickly they can be different. #todo mouse events are not supported Mouse buttons.todo not supported.Modifier keys. Key codes are interpreted such that users are more likely to have Meta than Alt; for instance on the PC Linux console, 4 will generally correspond to the physical Alt key.%Representations of non-modifier keys.WKFun is indexed from 0 to 63. Range of supported FKeys varies by terminal and keyboard.ZKUpLeft, KUpRight, KDownLeft, KDownRight, KCenter support varies by terminal and keyboard.dActually, support for most of these but KEsc, KChar, KBS, and KEnter vary by terminal and keyboard.(  !"#$%&'()*+,-(  !"#$%&'()*+,-(-,+*)('&%$#"!       -,+*)('&%$#"!  Safe-InferredM Safe-InferredMEncoding for navigation keys.ITODO: This is not the same as the input bytes pulled from teh caps table.-encoding for shift, meta and ctrl plus arrowshomeend2encoding for ins, del, pageup, pagedown, home, end9encoding for ctrl + ins, del, pageup, pagedown, home, end%encoding for shift plus function keys According to  Bhttp://aperiodic.net/phil/archives/Geekery/term-function-keys.html&This encoding depends on the terminal.encoding for meta plus charTODO: resolve - removed ESCA from second list due to duplication with "special_support_keys".removed '[' from second list due to conflict with 7-bit encoding for ESC. Whether meta+[ is the same as ESC should examine km and current encoding.stopped enumeration at '~' instead of '\DEL'7. The latter is mapped to KBS by special_support_keys. Safe-InferredM .xqueries the terminal for all capability based input sequences then adds on a terminal dependent input sequence mapping.For reference see: /http://vimdoc.sourceforge.net/htmldoc/term.htmlvim74srcterm.c #http://invisible-island.net/vttest/ Bhttp://aperiodic.net/phil/archives/Geekery/term-function-keys.htmlThis is painful. Terminfo is incomplete. The vim source implies that terminfo is also incorrect. Vty assumes that the an internal terminfo table added to the system provided terminfo table is correct. >build terminfo table for all caps. Missing caps are not added.9add tables for visible chars, esc, del plus ctrl and meta5add internally defined table for given terminal type.(Precedence is currently implicit in the compile algorithm. Which is a bit odd.2todo terminfo meta is not supported. todo no 8bit/&key table applicable to all terminals.<TODO: some probably only applicable to ANSI/VT100 terminals.1Itables specific to a given terminal that are not derivable from terminfo.TODO: Adds the ANSIVT100*VT50 tables regardless of term identifier.2:Visible characters in the ISO-8859-1 and UTF-8 common set.{we limit to < 0xC1. The UTF8 sequence detector will catch all values 0xC2 and above before this classify table is reached.?TODO: resolve 1. start at ' '. The earlier characters are all ctrlChar3XNon visible characters in the ISO-8859-1 and UTF-8 common set translated to ctrl + char.&todo resolve CTRL-i is the same as tab4Ctrl+Meta+Char55esc, meta esc, delete, meta delete, enter, meta enter6;classify table directly generated from terminfo cap strings these are:ka1 - keypad up-leftka3 - keypad up-rightkb2 - keypad centerkbs - keypad backspace kbeg - beginkcbt - back tabkc1 - keypad left-downkc3 - keypad right-downkdch1 - delete kcud1 - down kend - end kent - enterkf0 - kf63 - function keys khome - KHomekich1 - insert kcub1 - leftknp - next page (page down)kpp - previous page (page up) kcuf1 - rightkDC - shift deletekEND - shift endkHOM - shift homekIC - shift insertkLFT - shift leftkRIT - shift right kcuu1 - up7cap names for function keys ./01234567 ./01234567 ./01234567 ./01234567 Safe-InferredM8(Abstract data type representing a color.RCurrently the foreground and background color are specified as points in either a:16 color palette. Where the first 8 colors are equal to the 8 colors of the ISO 6429 (ANSI) 8 color palette and the second 8 colors are bright/vivid versions of the first 8 colors.240 color palette. This palette is a regular sampling of the full RGB colorspace for the first 224 colors. The remaining 16 colors is a greyscale palette.,The 8 ISO 6429 (ANSI) colors are as follows: black redgreenyellowbluemagentacyanwhiteBThe mapping from points in the 240 color palette to colors actually displayable by the terminal depends on the number of colors the terminal claims to support. Which is usually determined by the terminfo "colors" property. If this property is not being accurately reported then the color reproduction will be incorrect.If the terminal reports <= 16 colors then the 240 color palette points are only mapped to the 8 color pallete. I'm not sure of the RGB points for the "bright" colors which is why they are not addressable via the 240 color palette. If the terminal reports > 16 colors then the 240 color palette points are mapped to the nearest points in a ("color count" - 16) subsampling of the 240 color palette.All of this assumes the terminals are behaving similarly to xterm and rxvt when handling colors. And that the individual colors have not been remapped by the user. There may be a way to verify this through terminfo but I don't know it.,Seriously, terminal color support is INSANE.89:89:8:9 Safe-InferredM;RGB color to 240 color palette.ggenerated from 256colres.pl which is forked from xterm 256colres.pl todo: all values get clamped high.;;;None!"*HM<Styles are represented as an 8 bit word. Each bit in the word is 1 if the style attribute assigned to that bit should be applied and 0 if the style attribute should not be applied.=The style and color attributes can either be the terminal defaults. Or be equivalent to the previously applied style. Or be a specific value.ASpecifies the display attributes such that the final style and color values do not depend on the previously applied display attribute. The display attributes can still depend on the terminal's default colors (unfortunately).FoA display attribute defines the Color and Style of all the characters rendered after the attribute is applied.At most 256 colors, picked from a 240 and 16 color palette, are possible for the background and foreground. The 240 colors and 16 colors are points in different palettes. See Color for more information.K+Standard 8-color ANSI terminal color codes.L+Standard 8-color ANSI terminal color codes.M+Standard 8-color ANSI terminal color codes.N+Standard 8-color ANSI terminal color codes.O+Standard 8-color ANSI terminal color codes.P+Standard 8-color ANSI terminal color codes.Q+Standard 8-color ANSI terminal color codes.R+Standard 8-color ANSI terminal color codes.S3Bright/Vivid variants of the standard 8-color ANSI T3Bright/Vivid variants of the standard 8-color ANSI U3Bright/Vivid variants of the standard 8-color ANSI V3Bright/Vivid variants of the standard 8-color ANSI [ The 6 possible style attributes:standout underline reverseVideoblinkdim bold/brightp( The invisible, protect, and altcharset display attributes some terminals support are not supported via VTY.)\ The 6 possible style attributes:standout underline reverseVideoblinkdim bold/brightp( The invisible, protect, and altcharset display attributes some terminals support are not supported via VTY.)] The 6 possible style attributes:standout underline reverseVideoblinkdim bold/brightp( The invisible, protect, and altcharset display attributes some terminals support are not supported via VTY.)^ The 6 possible style attributes:standout underline reverseVideoblinkdim bold/brightp( The invisible, protect, and altcharset display attributes some terminals support are not supported via VTY.)_ The 6 possible style attributes:standout underline reverseVideoblinkdim bold/brightp( The invisible, protect, and altcharset display attributes some terminals support are not supported via VTY.)` The 6 possible style attributes:standout underline reverseVideoblinkdim bold/brightp( The invisible, protect, and altcharset display attributes some terminals support are not supported via VTY.)c:true if the given Style value has the specified Style set.dSet the foreground color of an F.eSet the background color of an F.fAdd the given style attributegSets the style, background color and foreground color to the default values for the terminal. There is no easy way to determine what the default background and foreground colors are.hKeeps the style, background color and foreground color that was previously set. Used to override some part of the previous style.EG: current_style d brightMagentavWould be the currently applied style (be it underline, bold, etc) but with the foreground color set to brightMagenta.0<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk189:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgh4FGHIJkABCDE=@?>jKRQPONMLSVUTWZYX<[`_^]\abcdefgih8:9;%<=@?>ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkNoneMlGThis is the internal representation of Images. Use the constructors in Graphics.Vty.Image to create instances. Images are:a horizontal span of text+a horizontal or vertical join of two imagesa two dimensional fill of the Pictures background charactera cropped image%an empty image of no size or content.The empty image8The combining operators identity constant. EmptyImage  | a = a EmptyImage  - a = a.Any image of zero size equals the empty image.DCrop an image vertically to a size by reducing the size from the topAlways  imageHeight croppedImage 0GCrop an image vertically to a size by reducing the size from the bottomHCrop an image horizontally to a size by reducing the size from the left.Always  imageWidth croppedImage 0ICrop an image horizontally to a size by reducing the size from the right.A background fill will be filled with the background char. The background char is defined as a property of the Picture this Image is used to form.A veritical join can be constructed between any two images. However a VertJoin instance is required to be between two images of equal width. The vertJoin constructor adds background fills to the provides images that assure this is true for the VertJoin value produced.A horizontal join can be constructed between any two images. However a HorizJoin instance is required to be between two images of equal height. The horizJoin constructor adds background fills to the provided images that assure this is true for the HorizJoin value produced.9imageHeight partLeft == imageHeight partRight. Always > 0GA horizontal text span is always >= 1 column and has a row height of 1.IThe text to display. The display width of the text is always outputWidth.7The number of display columns for the text. Always > 0.1the number of characters in the text. Always > 0.m"A display text is a Data.Text.LazyTODO(corey): hm. there is an explicit equation for each type which goes to a lazy text. Each application probably uses a single type. Perhaps parameterize the entire vty interface by the input text type? TODO: Try using a builder instead of a TL.Text instance directly. That might improve performance for the usual case of appending a bunch of characters with the same attribute together.,pretty print just the structure of an image.nPThe width of an Image. This is the number display columns the image will occupy.oQThe height of an Image. This is the number of display rows the image will occupy.p combines two images side by sidegCombines text chunks where possible. Assures outputWidth and outputHeight properties are not violated.The result image will have a width equal to the sum of the two images width. And the height will equal the largest height of the two images. The area not defined in one image due to a height missmatch will be filled with the background pattern.>TODO: the bg fill is biased towards top to bottom languages(?)qcombines two images verticallyThe result image will have a height equal to the sum of the heights of both images. The width will equal the largest width of the two images. The area not defined in one image due to a width missmatch will be filled with the background pattern.>TODO: the bg fill is biased towards right to left languages(?)/Append in the Monoid instance is equivalent to  -. lmnopqlmnopq l%mnopqNoneMrLAn area of the picture's bacground (See Background) of w columns and h rows.s5Combines two images horizontally. Alias for horizJoininfixr 5t2Combines two images vertically. Alias for vertJoininfixr 4u*Compose any number of images horizontally.v(Compose any number of images vertically.wA Data.Text.Lazy valuexA Data.Text valueyuan image of a single character. This is a standard Haskell 31-bit character assumed to be in the ISO-10646 encoding.zA string of characters layed out on a single row with the same display attribute. The string is assumed to be a sequence of ISO-10646 characters. Note: depending on how the Haskell compiler represents string literals a string literal in a UTF-8 encoded source file, for example, may be represented as a ISO-10646 string. That is, I think, the case with GHC 6.10. This means, for the most part, you don't need to worry about the encoding format when outputting string literals. Just provide the string literal directly to iso10646String or string.{Alias for iso10646String. Since the usual case is that a literal string like "foo" is represented internally as a list of ISO 10646 31 bit characters. Note: Keep in mind that GHC will compile source encoded as UTF-8 but the literal strings, while UTF-8 encoded in the source, will be transcoded to a ISO 10646 31 bit characters runtime representation.|oA string of characters layed out on a single row. The input is assumed to be the bytes for UTF-8 encoded text.})Renders a UTF-8 encoded lazy bytestring. ~+Renders a UTF-8 encoded strict bytestring. tcreates a fill of the specified character. The dimensions are in number of characters wide and number of rows high.gThe empty image. Useful for fold combinators. These occupy no space nor define any display attributes.pad the given image. This adds background character fills to the left, top, right, bottom. The pad values are how many display columns or rows to add.translates an image by padding or cropping the left and top. First param is amount to translate left. Second param is amount to translate top.|This can have an unexpected effect: Translating an image to less than (0,0) then to greater than (0,0) will crop the image.3translates an image by padding or cropping the left2translates an image by padding or cropping the topkEnsure an image is no larger than the provided size. If the image is larger then crop the right or bottom.cThis is transformed to a vertical crop from the bottom followed by horizontal crop from the right.crop the display height. If the image is less than or equal in height then this operation has no effect. Otherwise the image is cropped from the bottom.censure the image is no wider than the given width. If the image is wider then crop the right side.bensure the image is no wider than the given width. If the image is wider then crop the left side.crop the display height. If the image is less than or equal in height then this operation has no effect. Otherwise the image is cropped from the top.Generic resize. Pads and crops as required to assure the given display width and height. This is biased to pad/crop the right and bottom.vResize the width. Pads and crops as required to assure the given display width. This is biased to pad/crop the right.yResize the height. Pads and crops as required to assure the given display height. This is biased to pad/crop the bottom.rstuvwxyz{|}~V89:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghlmnopqrstuvwxyz{|}~%mlnopsqtuvrwxy{z|}~rstuvwxyz{|}~stNoneM  NoneMgStyle attribute changes are transformed into a sequence of apply/removes of the individual attributes.7Difference between two display color attribute changes.difference between two display attributes. Used in the calculation of the operations required to go from one display attribute to the next.Previously, vty would reset display attributes to default then apply the new display attributes. This turned out to be very expensive: A *lot* more data would be sent to the terminal than required.Given the previously applied display attributes as a FixedAttr and the current display attributes as an Attr produces a FixedAttr that represents the current display attributes. This is done by using the previously applied display attributes to remove the  KeepCurrent abstraction.:Used in the computation of a final style attribute change.9TODO(corey): not really a simplify but a monoid instance.hConsider two display color attributes diffs. What display color attribute diff are these equivalent to?9TODO(corey): not really a simplify but a monoid instance.Determines the diff between two display&color attributes. This diff determines the operations that actually get output to the terminal.   Safe-InferredMNamed alias for a Int pairH      !"#$%&'()*+,-./0123456789 None!"M Ovector of span operation vectors for display. One per row of the output region.'vector of span operations. executed in succession. This represents the operations required to render a row of the terminal. The operations in one row may effect subsequent rows. EG: Setting the foreground color in one row will effect all subsequent rows until the foreground color is changed.iThis represents an operation on the terminal. Either an attribute change or the output of a text string.Marks the end of a row. specifies how many columns are remaining. These columns will not be explicitly overwritten with the span ops. The terminal is require to assure the remaining columns are clear. todo: separate from this type.Skips the given number of columns A skip is transparent.... maybe? I am not sure how attribute changes interact. todo: separate from this type.a span of UTF-8 text occupies a specific number of screen space columns. A single UTF character does not necessarially represent 1 colunm. See Codec.Binary.UTF8.Width TextSpan [Attr] [output width in columns] [number of characters] [data]0Number of columns the DisplayOps are defined forKAll spans are verified to define same number of columns. See: VerifySpanOps-Number of rows the DisplayOps are defined for(The number of columns a SpanOps effects.'The width of a single SpanOp in columnsSreturns the number of columns to the character at the given position in the span op NoneM  NoneM A  has a background pattern. The background is either ClearBackground. Which shows the layer below or is blank if the bottom layer. Or the background pattern is a character and a display attribute. If the display attribute used previously should be used for a background fill then use h for the background attribute.utodo The current attribute is always set to the default attributes at the start of updating the screen to a picture.A ClearBackground is: 7the space character if there are remaining non-skip ops3End of line if there are no remaining non-skip ops.sA picture can be configured either to not show the cursor or show the cursor at the specified character position. There is not a 1 to 1 map from character positions to a row and column on the screen due to characters that take more than 1 column.todo: The Cursor can be given a (character,row) offset outside of the visible bounds of the output region. In this case the cursor will not be shown.)The type of images to be displayed using update. %Can be constructed directly or using _. Which provides an initial instance with reasonable defaults for picCursor and picBackground.4a picture with no cursor, background or image layers The given l" is added as the top layer of the  The given l% is added as the bottom layer of the Create a picture for display for the given image. The picture will not have a displayed cursor and no background pattern (ClearBackground) will be used.JCreate a picture for display with the given layers. Ordered top to bottom.fThe picture will not have a displayed cursor and no background apttern (ClearBackgroun) will be used. The first l is the top layer.ICompatibility with applications that do not use more than a single layer.i89:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghlmnopqrstuvwxyz{|}~  None:HMqProduces the span ops that will render the given picture, possibly cropped or padded, into the specified region.OReturns the DisplayOps for an image rendered to a window the size of the image.!largerly used only for debugging.8Produces the span ops for each layer then combines them.cTODO: a fold over a builder function. start with span ops that are a bg fill of the entire region. UBuilds a vector of row operations that will output the given picture to the terminal."Crops to the given display region.Rtodo I'm pretty sure there is an algorithm that does not require a mutable buffer. XAdd the operations required to build a given image to the current set of row operations.EThis adds an image that might be partially clipped to the output ops.This is a very touchy algorithm. Too touchy. For instance, the CropRight and CropBottom implementations are odd. They pass the current tests but something seems terribly wrong about all this.:todo prove this cannot be called in an out of bounds case.8snocs the operation to the operations for the given row.'     '     '           None !"3:HMThe cursor position is given in X,Y character offsets. Due to multi-column characters this needs to be translated to column, row positions.+Provide the bounds of the display context. >Reset the display attributes to the default display attributes See ';Text identifier for the output device. Used for debugging. )MClear the display and initialize the terminal to some initial display state. The expectation of a program is that the display starts in some initial state. The initial state would consist of fixed values:cursor at top leftUTF-8 character encoding'drawing characteristics are the defaultzThe abstract operation I think all these behaviors are instances of is reserving exclusive access to a display such that:'The previous state cannot be determinedYWhen exclusive access to a display is released the display returns to the previous state.*'Return the display to the state before )G If no previous state then set the display state to the initial state.+#Returns the current display bounds.,.Output the byte string to the terminal device.-2Maximum number of colors supported by the context..#if the cursor can be shown / hidden0Acquire display access to the given region of the display. Currently all regions have the upper left corner of (0,0) and the lower right corner at (max displayWidth providedWidth, max displayHeight providedHeight)3YAll terminals serialize UTF8 text to the terminal device exactly as serialized in memory.4Displays the given . *The image is cropped to the display size. >Converted into a sequence of attribute changes and text spans.The cursor is hidden.Serialized to the display.7The cursor is then shown and positioned or kept hidden.Ttodo: specify possible IO exceptions. abstract from IO monad to a MonadIO instance.:{Not all terminals support all display attributes. This filters a display attribute to what the given terminal can display.( !"#$%&'()*+,-./0123456789:( !"#$%&'()*+,-./0123456789:(%&'()*+,-./01!"#$2 3456789:  !"#$% &'()*+,-./0123456789:None24M:The sequence of terminfo caps to apply a given style are determined according to these rules. - - 1. The assumption is that it's preferable to use the simpler enter/exit mode capabilities than - the full set display attribute state capability. - - 2. If a mode is supposed to be removed but there is not an exit capability defined then the - display attributes are reset to defaults then the display attribute state is set. - - 3. If a mode is supposed to be applied but there is not an enter capability defined then then - display attribute state is set if possible. Otherwise the mode is not applied. - - 4. If the display attribute state is being set then just update the arguments to that for any - apply/remove. -;9Uses terminfo for all control codes. While this should provide the most compatible terminal - terminfo does not support some features that would increase efficiency and improve compatibility: - - * determine the character encoding supported by the terminal. Should this be taken from the LANG - environment variable? - - * Provide independent string capabilities for all display attributes. - - todo: Some display attributes like underline and bold have independent string capabilities that - should be used instead of the generic "sgr" string capability.;CPortably setting the display attributes is a giant pain in the ass.If the terminal supports the sgr capability (which sets the on/off state of each style directly ; and, for no good reason, resets the colors to the default) this procedure is used:  >set the style attributes. This resets the fore and back color.C1, If a foreground color is to be set then set the foreground color "likewise with the background colorIf the terminal does not support the sgr cap then: if there is a change from an applied color to the default (in either the fore or back color) then: #reset all display attributes (sgr0) enter required style modesset the fore color if requiredset the back color if requiredEntering the required style modes could require a reset of the display attributes. If this is the case then the back and fore colors always need to be set if not default.)This equation implements the above logic.ytodo This assumes the removal of color changes in the display attributes is done as expected with noColors == True. See :todo This assumes that fewer state changes, followed by fewer bytes, is what to optimize. I haven't measured this or even examined terminal implementations. *shrug*<~The color table used by a terminal is a 16 color set followed by a 240 color set that might not be supported by the terminal.yThis takes a Color which clearly identifies which pallete to use and computes the index into the full 256 color pallete.=!For terminals without setaf/setab8See table in `man terminfo` Will error if not in table.5>?@ABCDE:FGHIJKLMNOPQRSTUVWXYZ[\]^_`abc;defghi;<=jklm;;>?@ABCDE:GFH IJKLMNOPQRSTUVWXYZ[\]^_`abc;defghi;<=jklmNoneM<!Initialize the display to UTF-8. n:These sequences set xterm based terminals to UTF-8 output.?todo I don't know of a terminfo cap that is equivalent to this.o:These sequences set xterm based terminals to UTF-8 output.?todo I don't know of a terminfo cap that is equivalent to this.pI think xterm is broken: Reseting the background color as the first bytes serialized on a new line does not effect the background color xterm uses to clear the line. Which is used *after* the next newline.<nop<<<nopNone24=KM>:The mock display terminal produces a string representation of the requested picture. There is *not* an isomorphism between the string representation and the picture. The string representation is a simplification of the picture that is only useful in debugging VTY without considering terminal specific issues.$The mock implementation is useful in manually determining if the sequence of terminal operations matches the expected sequence. So requirement of the produced representation is simplicity in parsing the text representation and determining how the picture was mapped to terminal operations.yThe string representation is a sequence of identifiers where each identifier is the name of an operation in the algebra.=>=>=>=>None3=M BThe default is 1 character.C-The default is 100 milliseconds, 0.1 seconds.D:Debug information is appended to this file if not Nothing.EiThe (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 map directive.F1The input file descriptor to use. The default is qG2The output file descriptor to use. The default is rHtThe terminal name used to look up terminfo capabilities. The default is the value of the TERM environment variable.IMappings 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.J Config from s/config and $VTY_CONFIG_FILE?@ABCDEFGHIJKLMNOPQRSTUVWXY?@ABCDEFGHIJKLMNOPQRSTUVWI@ABCDEFGHYX?JKLMNOPQRSTUVW?@ABCDEFGHIJKLMNOPQRSTUVWXYNoneMZ Returns a % for the terminal specified in @The specific Output implementation used is hidden from the API user. All terminal implementations are assumed to perform more, or less, the same. Currently, all implementations use terminfo for at least some terminal specific information.Specifics about it being based on terminfo are hidden from the API user. If a terminal implementation is developed for a terminal without terminfo support then Vty should work as expected on that terminal.+Selection of a terminal is done as follows: If TERM == xterm use XTermColor./for any other TERM value TerminfoBased is used.todo add an implementation for windows that does not depend on terminfo. Should be installable with only what is provided in the haskell platform. Use ansi-terminal[<Sets the cursor position to the given output column and row.This is not necessarially the same as the character position with the same coordinates. Characters can be a variable number of columns in width.Currently, the only way to set the cursor position to a given character coordinate is to specify the coordinate in the Picture instance provided to outputPicture or refresh.\Hides the cursor]Shows the cursorZ[\]! !"#$%&'()*+,-./014Z[\]!Z[\]%&'()*+,-./0!"#$ 41Z[\] NoneM`7Channel of events direct from input processing. Unlike  nextEvent< this will not refresh the display if the next event is an .anShuts down the input processing. This should return the terminal input state to before the input initialized.b9Changes to this value are reflected after the next event.cinput debug log(^_`abctuvwxyz{|}~(^_`abctuvwxyz{|}~^_`abctuvwxyz{|}~NoneMd)Set up the terminal with file descriptor F for input. Returns a ^. The table used to determine the Events, to produce for the input bytes comes from .?. Which is then overridden by the the applicable entries from E.6The terminal device is configured with the attributes: IXON disabledIdisables software flow control on outgoing data. This stops the process from being suspended if the output terminal cannot keep up. I presume this has little effect these days. I hope this means that output will be buffered if the terminal cannot keep up. In the old days the output might of been dropped?"raw" mode is used for input. ISIG disabledfenables keyboard combinations that result in signals. TODO: should probably be a dynamic option. ECHO disabledCinput is not echod to the output. TODO: should be a dynamic option.ICANON disabledOcanonical mode (line mode) input is not used. TODO: should be a dynamic option.IEXTEN disabledCextended functions are disabled. TODO: I don't know what those are.d.  !"#$%&'()*+,-^_`abcd.-,+*)('&%$#"!    ^_`abcddNoneMe0The main object. At most one should be created..The use of Vty typically follows this process: initialize vty 3use the update equation of Vty to display a picturerepeat shutdown vty.6An alternative to tracking the Vty instance is to use withVty in Graphics.Vty.Inline.Unsafe.This does not assure any thread safety. In theory, as long as an update action is not executed when another update action is already then it's safe to call this on multiple threads.todo Remove explicit l requirement.g)Outputs the given Picture. Equivalent to 4i applied to a display context implicitly managed by Vty. The managed display context is reset on resize.h_Get one Event object, blocking if necessary. This will refresh the terminal if the event is a .iThe input interface. See ^jThe output interface. See %kRefresh the display. h will refresh the display if a resize occurs. If other programs output to the terminal and mess up the display then the application might want to force a refresh.lbClean up after vty. The above methods will throw an exception if executed after this is executed.mzSet up the state object for using vty. At most one state object should be created at a time for a given terminal device.%The specified config is added to the J . With the J taking precedence. See Graphics.Vty.ConfigFor most applications  mkVty def is sufficient. efghijklm  !"#$%&'()*+,-89:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghlmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./014?@ABCDEFGHIJKLMNOPQRSTUVWZ[\]^_`abcdefghijklm efghijklmefghijklm!NoneMn&This will create a Vty instance using mi and execute an IO action provided that instance. The created Vty instance will be stored to the unsafe  .BThis instance will use duplicates of the stdin and stdout Handles.nnnNoneMp)Set the background color to the provided 8q)Set the foreground color to the provided 8rAttempt to change the < of the following text.hIf the terminal does not support the style change no error is produced. The style can still be removed.s Attempt to remove the specified <( from the display of the following text.QThis will fail if applyStyle for the given style has not been previously called. tReset the display attributesuQApply the provided display attribute changes to the given terminal output device.!This does not flush the terminal.vApply the provided display attributes changes to the terminal output device that was current at the time this was first used. Which, for most use cases, is the current terminal.$This will flush the terminal output.opqrstuv nopqrstuv opqrstuvnopqrstuv"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abccdefgghijklmnopqrstuvwxyz{|}~                                                    ! " # $ % & ' ( ) * * + , , - . / 0 1 2 3 4  5 5 6 7 8 8 9 : ; < = > ? @ A B C D E F G H I J K LMMNOPQQRSTUVWXYZ[\]^_`abcdefghijklm n n o p q rsttuvwxyz{!|}~                        ! " # $ % & ' '()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMMNOPQRSTUVVWXYZ[\]^__`abcdefghijklmnopqrstuvwxyz{|}~}~                                  !!!! vty-5.4.0Graphics.Text.WidthGraphics.Vty.ErrorGraphics.Vty.Input.EventsGraphics.Vty.Input.TerminfoGraphics.Vty.AttributesGraphics.Vty.ImageGraphics.Vty.DebugGraphics.Vty.DisplayAttributesGraphics.Vty.PreludeGraphics.Vty.SpanGraphics.Vty.PictureGraphics.Vty.PictureToSpansGraphics.Vty.Output.Interface!Graphics.Vty.Output.TerminfoBasedGraphics.Vty.Output.XTermColorGraphics.Vty.Output.MockGraphics.Vty.ConfigGraphics.Vty.OutputGraphics.Vty.Input Graphics.VtyGraphics.Vty.InlineData.Terminfo.ParseData.Terminfo.EvalCodec.Binary.UTF8.DebugGraphics.Vty.Input.Classify"Graphics.Vty.Input.Terminfo.ANSIVTGraphics.Vty.Attributes.Color Graphics.Vty.Attributes.Color240Graphics.Vty.Image.InternalGraphics.Vty.Debug.Image inlineHackGraphics.Vty.Input.LoopGraphics.Vty.Inline.Unsafewcwidthwcswidth safeWcwidth safeWcswidth VtyException VtyFailure ClassifyMapEventEvResizeEvMouseEvKeyButtonBRightBMiddleBLeftModifierMAltMMetaMCtrlMShiftKeyKMenuKBegin KPageDownKEndKDelKPageUpKHomeKInsKPauseKPrtScrKBackTabKFunKCenter KDownRight KDownLeftKUpRightKUpLeftKDownKUpKRightKLeftKEnterKBSKCharKEscclassifyMapForTermuniversalTablecapsClassifyMaptermSpecificTables visibleChars ctrlChars ctrlMetaCharsspecialSupportKeyskeysFromCapsTablefunctionKeyCapsTableColorColor240ISOColorrgbColorStyle MaybeDefaultSetTo KeepCurrentDefault FixedAttr fixedStylefixedForeColorfixedBackColorAttr attrStyle attrForeColor attrBackColorblackredgreenyellowbluemagentacyanwhite brightBlack brightRed brightGreen brightYellow brightBlue brightMagenta brightCyan brightWhitestandout underline reverseVideoblinkdimbolddefaultStyleMask styleMaskhasStyle withForeColor withBackColor withStyledefAttr currentAttr $fDefaultAttr$fMonoidMaybeDefault $fMonoidAttrImage DisplayText imageWidth imageHeight horizJoinvertJoinbackgroundFill<|><->horizCatvertCattexttext'chariso10646Stringstring utf8Stringutf8Bytestringutf8Bytestring'charFill emptyImagepad translate translateX translateYcrop cropBottom cropRightcropLeftcropTopresize resizeWidth resizeHeight ImageEndoImageOpImageConstructEventImageConstructLogforwardImageOpsforwardTransformreverseTransform debugImageOps idImageOpStyleStateChange RemoveBold ApplyBold RemoveDimApplyDim RemoveBlink ApplyBlinkRemoveReverseVideoApplyReverseVideoRemoveUnderlineApplyUnderlineRemoveStandout ApplyStandoutDisplayColorDiffSetColor NoColorChangeColorToDefaultDisplayAttrDiff styleDiffs foreColorDiff backColorDifffixDisplayAttrsimplifyStyleDiffssimplifyColorDiffsdisplayAttrDiffs diffColor diffStyles$fMonoidDisplayAttrDiff DisplayRegion regionWidth regionHeight DisplayOpsSpanOpsSpanOpRowEndSkipTextSpan textSpanAttrtextSpanOutputWidthtextSpanCharWidth textSpanTextdropOps splitOpsAtdisplayOpsColumnsdisplayOpsRowseffectedRegionspanOpsEffectedColumnsspanOpHasWidthcolumnsToCharOffset $fShowSpanOp MockWindowSpanConstructEvent SpanSetAttrSpanConstructLogrowOpsEffectedColumnsallSpansHaveWidthspanOpsEffectedRows isSetAttrregionForWindow BackgroundClearBackgroundbackgroundCharbackgroundAttrCursorNoCursorPicture picCursor picLayers picBackground emptyPictureaddToTop addToBottom picForImage picForLayerspicImage$fNFDataBackground$fNFDataCursor$fNFDataPicture $fShowPicture BlitState _columnOffset _rowOffset _skipColumns _skipRows_remainingColumns_remainingRowsMSpanOpsMRowOpsBlitEnv_region_mrowOps columnOffsetremainingColumns remainingRows rowOffset skipColumnsskipRowsBlitMmrowOpsregiondisplayOpsForPicdisplayOpsForImagecombinedOpsForLayerssubstituteSkips mergeUnder mergeRowUnder swapSkipsForSingleColumnCharSpanswapSkipsForCharSpan buildSpansstartImageBuild isOutOfBoundsaddMaybeClippedaddMaybeClippedJoinaddUnclippedTextaddRowCompletionsnocOpCursorOutputMapcharToOutputPosDisplayContext contextDevice contextRegionwriteMoveCursorwriteShowCursorwriteHideCursor writeSetAttrwriteDefaultAttr writeRowEnd AssumedState prevFattr prevOutputOpsOutput terminalIDreleaseTerminalreserveDisplayreleaseDisplay displayBoundsoutputByteBuffercontextColorCountsupportsCursorVisibilityassumedStateRefmkDisplayContextdisplayContextinitialAssumedState writeUtf8Text outputPicturewriteOutputOps writeSpanOps writeSpanOpcursorOutputMapcursorColumnOffsetlimitAttrForDisplayreserveTerminalMockData mockTerminal ConfigParserConfigvminvtimedebugLoginputMapinputFdoutputFdtermNameInputMap userConfigoverrideEnvConfigstandardIOConfigparseConfigFilerunParseConfigconfigLanguage configLexermapDeclparseKeyparseModifiers parseModifier debugLogDecl ignoreLine parseConfig$fMonoidConfig$fDefaultConfigoutputForConfig setCursorPos hideCursor showCursorInput _eventChannel shutdownInput _configRef _inputDebuginputForConfigVtyupdate nextEvent inputIface outputIfacerefreshshutdownmkVtywithVtyInlineM backColor foreColor applyStyle removeStyle defaultAll putAttrChangeputAttrChange_ BuildResults outParamCount outCapOps outParamOps BuildState nextOffset CapParserParamOp IncFirstTwoParamOpsCapOp CompareGt CompareLt CompareEq ArithMinus ArithPlus BitwiseAnd BitwiseXOr BitwiseOr ConditionalconditionalExprconditionalParts PushValue PushParamCharOutDecOutBytesCapOpsCapParam CapExpressioncapOpscapBytes sourceString paramCountparamOpsparseCapExpressionconstructCapExpressioncapExpressionParserparamEscapeParserliteralPercentParser paramOpParserincrementOpParser pushOpParser decOutParser charOutParserconditionalOpParserconditionalTrueParserconditionalFalseParserconditionalEndParserbitwiseOpParserbitwiseOrParserbitwiseAndParserbitwiseXorParser arithOpParserliteralIntOpParsercompareOpParser bytesOpParsercharConstParser incOffsetinitialBuildState$fMonoidBuildResults$fNFDataParamOp $fNFDataCapOp$fNFDataCapExpression$fShowCapExpression parsec-3.1.9Text.Parsec.Error ParseError EvalStateEval evalStackevalExpression evalParamspop readParampush applyParamOps applyParamOp writeCapExpr writeCapOps writeCapOp utf8FromIsoppUtf8KClassPrefixInvalidValidcompileclassify classifyUtf8 utf8LengthnavKeys0navKeys1navKeys2navKeys3 functionKeys1 functionKeys2 classifyTable EmptyImageCropToptopSkip CropBottomCropLeftleftSkip CropRightBGFillVertJoin HorizJoin outputHeight HorizText displayText outputWidth charWidthppImageStructure $fMonoidImage croppedImagepartTop partBottompartLeft partRightattrclipText $fNFDataImage $fShowImagebaseGHC.Basefail>>=>>fmapreturn Control.MonadguardliftMjoinControl.Applicative<*>pure AlternativeMonadFunctor MonadPlus ApplicativeoptionalliftA3liftA2liftA<**><**>manysomeemptygetConstConst unwrapMonad WrapMonad WrappedMonad unwrapArrow WrapArrow WrappedArrow getZipListZipList Data.Functor<$>mfilterapliftM5liftM4liftM3liftM2unlesswhen replicateM_ replicateMfoldM_foldM zipWithM_zipWithM mapAndUnzipMvoidforever<=<>=>msumforM_forMfilterMmapM_mapM sequence_sequence=<<mplusmzero<$DisplayAttrSeqterminfoWriteSetAttransiColorIndex altColorIndexDisplayAttrState applyStandoutapplyUnderlineapplyReverseVideo applyBlinkapplyDim applyBoldSetState EnterExitSeqDisplayAttrCaps setAttrStates enterStandout exitStandoutenterUnderline exitUnderlineenterReverseVideo enterDimMode enterBoldMode TerminfoCapssmcuprmcupcupcnormcivissupportsNoColorsuseAltColorMap setForeColor setBackColorsetDefaultAttr clearScreenclearEoldisplayAttrCapsc_getWindowSize fdWriteAllsendCapToTerminal requireCapprobeCapparseCapcurrentDisplayAttrCaps getWindowSizeterminfoDisplayContextsgrArgsForStatereqDisplayCapSeqFor stateForStylestyleToApplySeqsetUtf8CharSetsetDefaultCharSetxtermInlineHack unix-2.7.0.1System.Posix.IO.CommonstdInput stdOutputdirectory-1.2.1.0System.DirectorygetAppUserDataDirectory InputBuffer_ptr_size configRef eventChannel inputDebug InputState_unprocessedBytes_appliedConfig _inputBuffer _classifierptrsizeInputM setTermTiming appliedConfig classifier inputBufferunprocessedByteslogMsgloopInputProcessoraddBytesToProcessemitreadFromDevice applyConfig parseEvent dropInvalidrunInputProcessorLoopattributeControllogInitialInputState initInput forkOSFinallyintMkVty GHC.IORefIORef globalVty globalOutput mkDupeConfig withOutput