i      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~#Safe5T Events.8A keyboard key was pressed with the specified modifiers.tA mouse button was pressed at the specified column and row. Any modifiers available in the event are also provided.A mouse button was released at the specified column and row. Some terminals report only that a button was released without specifying which one; in that case, Nothing is provided. Otherwise Just the button released is included in the event. 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.A paste event occurs when a bracketed paste input sequence is received. For terminals that support bracketed paste mode, these events will be triggered on a paste event. Terminals that do not support bracketed pastes will send the paste contents as ordinary input (which is probably bad, so beware!) Note that the data is provided in raw form and you'll have to decode (e.g. as UTF-8) if that's what your application expects.Mouse buttons. Modifier keys. Key codes are interpreted such that users are more likely to have Meta than Alt; for instance on the PC Linux console, 3 will generally correspond to the physical Alt key.%Representations of non-modifier keys.XKFun is indexed from 0 to 63. Range of supported FKeys varies by terminal and keyboard.[KUpLeft, 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.*  !"#$%&'()*  !"#$%&'()* !"#$%&'()     !"#$%&'()SafeTEncoding for navigation keys.-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 char removed ESCB 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.SafeT >|Queries the terminal for all capability-based input sequences and 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.htmlTerminfo is incomplete. The vim source implies that terminfo is also incorrect. Vty assumes that the internal terminfo table added to the system-provided terminfo table is correct.The procedure used here is: >Build terminfo table for all caps. Missing caps are not added.7Add tables for visible chars, esc, del, ctrl, and meta.5Add internally-defined table for given terminal type.(Precedence is currently implicit in the compile algorithm.?*The key table applicable to all terminals.VNote that some of these entries are probably only applicable to ANSI/VT100 terminals.AJTables specific to a given terminal that are not derivable from terminfo.Note that this adds the ANSIVT100+VT50 tables regardless of term identifier.B: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.C[Non-printable characters in the ISO-8859-1 and UTF-8 common set translated to ctrl + char.#This treats CTRL-i the same as tab.DCtrl+Meta+CharE6Esc, meta-esc, delete, meta-delete, enter, meta-enter.FQA classification 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 - upGCap names for function keys. >?@ABCDEFG >?@ABCDEFG >?@ABCDEFG >?@ABCDEFGSafeTIYA valid event was parsed. Any unused characters from the input stream are also provided.J5The input characters did not represent a valid event.KJThe input characters form the prefix of a valid event character sequence.HIJKHKIJHIJKHIJKSafeTN'Does the input start a bracketed paste?O2Does the input contain a complete bracketed paste?PIParse a bracketed paste. This should only be called on a string if both N and O return .NOPNOPPNONOPSafeTRCRun a parser on a given input string. If the parser fails, return J$. Otherwise return the valid event (I)) and the remaining unparsed characters.SFail a parsing operation.TRead an integer from the input stream. If an integer cannot be read, fail parsing. E.g. calling readInt on an input of "123abc" will return '123' and consume those characters.UmRead a character from the input stream. If one cannot be read (e.g. we are out of characters), fail parsing.V^Read a character from the input stream and fail parsing if it is not the specified character.QRSTUVQRSTUVQRSTUVQRSTUVSafeTWIThese sequences set xterm-based terminals to send mouse event sequences.X%These sequences disable mouse events.Y3Does the specified string begin with a mouse event?Z4Attempt to lassify an input string as a mouse event.WXYZWXYZWXYZWXYZSafeTHKIJSafeT['The type of exceptions specific to vty.ZThese have fully qualified names by default since, IMO, exception handling requires this.\&Uncategorized failure specific to vty.[\[\[\[\Safe09:;QRT]A Vty configuration._The default is 1 character.`-The default is 100 milliseconds, 0.1 seconds.aThe default is False.bThe default is False.c:Debug information is appended to this file if not Nothing.diThe (input byte, output event) pairs extend the internal input table of VTY and the table from terminfo.See Graphics.Vty.Config0 module documentation for documentation of the map directive.e2The input file descriptor to use. The default is f3The output file descriptor to use. The default is gtThe terminal name used to look up terminfo capabilities. The default is the value of the TERM environment variable.hMappings 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.i6Type of errors that can be thrown when configuring VTYj!TERM environment variable not setlLoad a configuration from /config and $VTY_CONFIG_FILE.nOConfigures VTY using defaults suitable for terminals. This function can raise i.1]^_`abcdefghijklmnopqrstuvwxyz{|}~]^g_`abcdefhijklmnoph]^_`abcdefgijlmnpok#] ^_`abcdefghijklmnopqrstuvwxyz{|}~None!"T8Channel of events direct from input processing. Unlike  nextEvent< this will not refresh the display if the next event is an .mShuts down the input processing. This should return the terminal input state to before he input initialized.9Changes to this value are reflected after the next event.input debug log*     *           None!"T)Set up the terminal with file descriptor e for input. Returns an . The table used to determine the Events, to produce for the input bytes comes from >R which is then overridden by the the applicable entries from the configuration's d.6The terminal device is configured with the attributes:IXON disabled: disables software flow control on outgoing data. This stops the process from being suspended if the output terminal cannot keep up.Raw mode is used for input.EISIG disabled (enables keyboard combinations that result in signals)1ECHO disabled (input is not echoed to the output)>ICANON disabled (canonical mode (line mode) input is not used)1IEXTEN disabled (extended functions are disabled)0  !"#$%&'()0 !"#$%&'()  SafeT (Abstract data type representing a color.SCurrently 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: blackredgreenyellowbluemagentacyanwhiteCThe 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.+Standard 8-color ANSI terminal color codes.+Standard 8-color ANSI terminal color codes.+Standard 8-color ANSI terminal color codes.+Standard 8-color ANSI terminal color codes.+Standard 8-color ANSI terminal color codes.+Standard 8-color ANSI terminal color codes.+Standard 8-color ANSI terminal color codes.+Standard 8-color ANSI terminal color codes.2Bright/Vivid variants of the standard 8-color ANSI2Bright/Vivid variants of the standard 8-color ANSI2Bright/Vivid variants of the standard 8-color ANSI2Bright/Vivid variants of the standard 8-color ANSISafeT Create a Vty + (in the 240 color set) from an RGB triple. Safe%&/OTStyles 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.Specifies 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).oA 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. The 6 possible style attributes:standout underline reverseVideoblinkdim bold/brighto(The invisible, protect, and altcharset display attributes some terminals support are not supported via VTY.) The 6 possible style attributes:standout underline reverseVideoblinkdim bold/brighto(The invisible, protect, and altcharset display attributes some terminals support are not supported via VTY.) The 6 possible style attributes:standout underline reverseVideoblinkdim bold/brighto(The invisible, protect, and altcharset display attributes some terminals support are not supported via VTY.) The 6 possible style attributes:standout underline reverseVideoblinkdim bold/brighto(The invisible, protect, and altcharset display attributes some terminals support are not supported via VTY.) The 6 possible style attributes:standout underline reverseVideoblinkdim bold/brighto(The invisible, protect, and altcharset display attributes some terminals support are not supported via VTY.) The 6 possible style attributes:standout underline reverseVideoblinkdim bold/brighto(The invisible, protect, and altcharset display attributes some terminals support are not supported via VTY.):true if the given Style value has the specified Style set.Set the foreground color of an .Set the background color of an .Add the given style attributeSets 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.Keeps the style, background color and foreground color that was previously set. Used to override some part of the previous style.EG: current_style  brightMagentavWould be the currently applied style (be it underline, bold, etc) but with the foreground color set to brightMagenta.11 SafeTgStyle 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.hConsider two display color attributes diffs. What display color attribute diff are these equivalent to?Determines the diff between two display&color attributes. This diff determines the operations that actually get output to the terminal.  NoneTbReturns 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.None#5THThis 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.-A horizontal text span has a row height of 1.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.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 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.JCrop an image horizontally to a size by reducing the size from the right.ICrop an image horizontally to a size by reducing the size from the left.HCrop an image vertically to a size by reducing the size from the bottomECrop an image vertically to a size by reducing the size from the topThe empty image7The combining operators identity constant. EmptyImage  | a = a EmptyImage  - a = a.Any image of zero size equals the empty image.JThe text to display. The display width of the text is always outputWidth.+The number of display columns for the text.%the number of characters in the text. 9imageHeight partLeft == imageHeight partRight. Always > 0!Always  imageWidth croppedImage 0"Always  imageHeight croppedImage 0"A display text is a Data.Text.Lazy#,pretty print just the structure of an image.QThe width of an Image. This is the number display columns the image will occupy.RThe height of an Image. This is the number of display rows the image will occupy. 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.combines 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.$/Append in the Monoid instance is equivalent to  -. %&' ()*!"+#$,-%!&' ()*"+# %%&' ()  * *! * *" +#$,- None!#T2A region of the display (first width, then height))An area of the picture's background (See  Background).7Combines two images horizontally. This is an alias for .infixr 55Combines two images vertically. This is an alias for .infixr 4_Compose any number of images together horizontally, with the first in the list being leftmost.SCompose any number of images vertically, with the first in the list being topmost.Make an  from a lazy text value.Make an  from a text value.|Make an image from a single character. This is a standard Haskell 31-bit character assumed to be in the ISO-10646 encoding.Make an image from a 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.Make an  from a ..This is an 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.Make an u from a string of characters layed out on a single row. The input is assumed to be the bytes for UTF-8 encoded text.Make an & from a UTF-8 encoded lazy bytestring.Make an & from a UTF-8 encoded lazy bytestring.<Make an image filling a region with the specified character.jThe empty image. Useful for fold combinators. These occupy no space and do not affect display attributes.[Pad the given image. This adds background character fills to the left, top, right, bottom.<Translates an image by padding or cropping the left and top.>If translation offsets are negative then the image is cropped.9Translates an image by padding or cropping its left side.3Translates an image by padding or cropping its top.kEnsure an image is no larger than the provided size. If the image is larger then crop the right or bottom.bThis is equivalent to a vertical crop from the bottom followed by horizontal crop from the right. Crop an image's height. If the image's height is less than or equal to the specified height then this operation has no effect. Otherwise the image is cropped from the bottom. Crop an image's width. If the image's width is less than or equal to the specified width then this operation has no effect. Otherwise the image is cropped from the right. Crop an image's width. If the image's width is less than or equal to the specified width then this operation has no effect. Otherwise the image is cropped from the left. Crop an image's height. If the image's height is less than or equal to the specified height then this operation has no effect. Otherwise the image is cropped from the top. Generic resize. Pads and crops are added to ensure that the resulting image matches the specified dimensions. This is biased to pad/crop the right and bottom.yResize the width. Pads and crops as required to assure the given display width. This is biased to pad/crop on the right.|Resize the height. Pads and crops as required to assure the given display height. This is biased to pad/crop on the bottom.Fill width in columnsFill height in rowsThe attribute to use.+The character to use in filling the region.The region width.The region height.6How much padding to add to the left side of the image.0How much padding to add to the top of the image.7How much padding to add to the right side of the image.3How much padding to add to the bottom of the image.The image to pad.3The horizontal translation offset (can be negative)1The vertical translation offset (can be negative)The image to translate.Cropping widthCropping heightThe image to crop     (     (          54NoneT   NoneTA $4 has a background pattern. The background is either:OClearBackground, which shows the layer below or is blank if the bottom layer#A character and a display attributeXIf the display attribute used previously should be used for a background fill then use  for the background attribute.A ClearBackground is:7the space character if there are remaining non-skip ops3End of line if there are no remaining non-skip ops. jA picture can be configured to hide the cursor or to show the cursor at the specified character position.There is not a 1:1 map from character positions to a row and column on the screen due to characters that take more than 1 column.!Hide the cursor"wShow the cursor at the given logical column accounting for character width in the presence of multi-column characters.#=Show the cursor at the given absolute terminal column and row$A Vty picture.+These can be constructed directly or using ,.&The picture's cursor.',The picture's image layers (top-most first).(JThe picture's background to be displayed in locations with no Image data.)5A picture with no cursor, background or image layers.*Add an  as the top-most layer of a $.+Add an  as the bottom-most layer of a $.,Create a picture from the given image. The picture will not have a displayed cursor and no background pattern (ClearBackground) will be used.-7Create a picture with the given layers, top-most first.fThe picture will not have a displayed cursor and no background pattern (ClearBackgroun) will be used..Return the top-most * layer for a picture. This is unsafe for $s without at least one layer._This is provided for compatibility with applications that do not use more than a single layer. !"#$%&'()*+,-./012 "!#$%&'()*+,-.$%&'( !"#)*+,-.  !"#$%&'()*+,-./012None#%&T 3RA vector of span operation vectors for display, one per row of the output region.42A 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 affect subsequent rows. For example, setting the foreground color in one row will affect all subsequent rows until the foreground color is changed.5iThis represents an operation on the terminal: either an attribute change or the output of a text string.6A span of UTF-8 text occupies a specific number of screen space columns. A single UTF character does not necessarily represent 1 colunm. See Codec.Binary.UTF8.Width TextSpan [Attr] [output width in columns] [number of characters] [data]7"Skips the given number of columns.8Marks 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.?5The number of columns the DisplayOps are defined for.8All spans are verified to define same number of columns.@2The number of rows the DisplayOps are defined for.B(The number of columns a SpanOps affects.C(The width of a single SpanOp in columns.DMThe number of columns to the character at the given position in the span op.3456789:;<=>?@ABCDE3457689:;<=>?@ABCD56789:;<4=>3E?@ABCD 3456789:;<=>?@ABCDENoneT GHIJKLMNOPGHIJKLMNOPLMNKIJOGHPGHIJKLMNOPNone#AOTjqProduces the span ops that will render the given picture, possibly cropped or padded, into the specified region.kPReturns the DisplayOps for an image rendered to a window the size of the image.!largerly used only for debugging.l8Produces the span ops for each layer then combines them.rVBuilds a vector of row operations that will output the given picture to the terminal."Crops to the given display region.sYAdd the operations required to build a given image to the current set of row operations.uFThis 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.y8snocs the operation to the operations for the given row.)STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{)STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{)\[STUVWXYZfedcba]^_`ihgjklmnopqrstuvwxyz{STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{None %&:AOT/The 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.Sets the output position to the specified row and column where the number of bytes required for the control codes can be specified seperate from the actual byte sequence.?Reset the display attributes to the default display attributes.See  "The Vty terminal output interface.:Text identifier for the output device. Used for debugging.lRelease the terminal just prior to application exit and reset it to its state prior to application startup.MClear the display and initialize the terminal to some initial display state.The expectation of a program is that the display starts in some The initial state. initial state would consist of fixed values:cursor at top leftUTF-8 character encoding'drawing characteristics are the default'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 bytestring to the terminal device.ASpecifies the maximum number of colors supported by the context.3Specifies whether the cursor can be shown / hidden.<Indicates support for terminal modes for this output device.FEnables or disables a mode (does nothing if the mode is unsupported)."Returns whether a mode is enabled.Acquire 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)$Ring the terminal bell if supported.7Returns whether the terminal has an audio bell feature.9Modal terminal features that can be enabled and disabled.NMouse mode (whether the terminal is configured to provide mouse input events)OPaste mode (whether the terminal is configured to provide events on OS pastes)0ZAll terminals serialize UTF8 text to the terminal device exactly as serialized in memory.Displays 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.{Not all terminals support all display attributes. This filters a display attribute to what the given terminal can display.0/12|}~034567'|}~'|}~/12| }~034567None9;DRT9The 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 matche the expected sequence. The 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.!None#TD89:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{@|89;:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv'89:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{"NoneT}capability evaluator state~} ~}None!"9;TThe 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.Constructs an output driver that uses 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:zdetermining the character encoding supported by the terminal. Should this be taken from the LANG environment variable?IProviding independent string capabilities for all display attributes.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.Note that this assumes the removal of color changes in the display attributes is done as expected with noColors == True. See .JNote that this optimizes for fewer state changes followed by fewer bytes.~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.6 NoneTBConstruct an Xterm output driver. Initialize the display to UTF-8.Enable bracketed paste mode: #http://cirw.in/blog/bracketed-pasteDisable bracketed paste mode::These sequences set xterm based terminals to UTF-8 output.9There is no known terminfo capability equivalent to this.:These sequences set xterm based terminals to UTF-8 output.9There is no known terminfo capability equivalent to this.I 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.None!"#T Returns an  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.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:5If TERM contains "xterm" or "screen", use XTermColor.'otherwise use the TerminfoBased driver.<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  or refresh.Hides the cursor.Shows the cursor.NoneTiA Vty value represents a handle to the Vty library that the application must create in order to use Vty..The use of Vty typically follows this process: Initialize vtyUse  to display a picture.Use  to get the next input event.%Depending on the event, go to 2 or 5. Shutdown vty..Operations on Vty handles are not thread-safe.Outputs the given $.Get one [ object, blocking if none are available. This will refresh the terminal if the event is a .The input interface. See .The output interface. See .Refresh the display.  will refresh the display if a resize occurs, but this can be used to refresh the display explicitly. If other programs output to the terminal and mess up the display then the application might want to force a refresh using this function.Clean up after vty. A call to this function is necessary to cleanly restore the terminal state before application exit. The above methods will throw an exception if executed after this is executed.aCreate a Vty handle. At most one handle should be created at a time for a given terminal device.IThe specified configuration is added to the the configuration loaded by l with the l' configuration taking precedence. See Graphics.Vty.Config.For most applications mkVty defaultConfig is sufficient.   !"#$%&'()]^g_`abcdefhijklmnop      "!#$%&'()*+,-.|}~ #NoneT&This will create a Vty instance using j 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.NoneT)Set the background color to the provided .)Set the foreground color to the provided .Attempt to change the  of the following text..mIf the terminal does not support the style change then no error is produced. The style can still be removed. Attempt to remove the specified ) from the display of the following text.This will fail if 5 for the given style has not been previously called.Reset the display attributes.RApply the provided display attribute changes to the given terminal output device.!This does not flush the terminal.MApply the provided display attributes changes to the terminal output device.$This will flush the terminal output.  $SafeT~Converts an array of ISO-10646 characters (Char type) to an array of Word8 bytes that is the corresponding UTF8 byte sequence%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                            ! " # $ % & ' ( ) * + , - . /0112234567899:;<=>=?@@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abbcdefghijklmmnopqrstuvvwxyz{|}~ #v       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGFHIJKLM!N!N!O!P!Q!R!R!S!T!U!V!W!X!Y!Z![!\!]!^!_!`!a!b!c!d!e!f!g!h!i!j!k!k!l!m!n!o!p!q!r!s!t!u!v!w!x!y!z!{!|!}!~!!!!!!!!!!!!!!!!""""""""""""""C####$$vty-5.15-C3we1pXBWr1L9EV4hxaWtDGraphics.Vty.Input.EventsGraphics.Vty.Input.Terminfo!Graphics.Vty.Input.Classify.TypesGraphics.Vty.Input.Paste!Graphics.Vty.Input.Classify.ParseGraphics.Vty.Input.MouseGraphics.Vty.ErrorGraphics.Vty.ConfigGraphics.Vty.InputGraphics.Vty.AttributesGraphics.Vty.DisplayAttributesGraphics.Text.WidthGraphics.Vty.ImageGraphics.Vty.DebugGraphics.Vty.PictureGraphics.Vty.SpanGraphics.Vty.PictureToSpansGraphics.Vty.Output.InterfaceGraphics.Vty.Output.Mock!Graphics.Vty.Output.TerminfoBasedGraphics.Vty.Output.XTermColorGraphics.Vty.Output Graphics.VtyGraphics.Vty.Inline"Graphics.Vty.Input.Terminfo.ANSIVTGraphics.Vty.Input.ClassifyGraphics.Vty.Input.LoopGraphics.Vty.Attributes.Color Graphics.Vty.Attributes.Color240Graphics.Vty.Image.InternalGraphics.Vty.Debug.Image inlineHackData.Terminfo.ParseData.Terminfo.EvalGraphics.Vty.Inline.UnsafeCodec.Binary.UTF8.Debug ClassifyMapEventEvKey EvMouseDown EvMouseUpEvResizeEvPasteButtonBLeftBMiddleBRightModifierMShiftMCtrlMMetaMAltKeyKEscKCharKBSKEnterKLeftKRightKUpKDownKUpLeftKUpRight KDownLeft KDownRightKCenterKFunKBackTabKPrtScrKPauseKInsKHomeKPageUpKDelKEnd KPageDownKBeginKMenu$fEqKey $fShowKey $fReadKey$fOrdKey $fGenericKey $fEqModifier$fShowModifier$fReadModifier $fOrdModifier$fGenericModifier $fEqButton $fShowButton $fReadButton $fOrdButton$fGenericButton $fEqEvent $fShowEvent $fReadEvent $fOrdEvent$fGenericEventclassifyMapForTermuniversalTablecapsClassifyMaptermSpecificTables visibleChars ctrlChars ctrlMetaCharsspecialSupportKeyskeysFromCapsTablefunctionKeyCapsTableKClassValidInvalidPrefix $fShowKClass $fEqKClassbracketedPasteStartedbracketedPasteFinishedparseBracketedPasteParser runParser failParsereadIntreadChar expectCharrequestMouseEventsdisableMouseEvents isMouseEventclassifyMouseEvent VtyException VtyFailureConfigvminvtime mouseModebracketedPasteModedebugLoginputMapinputFdoutputFdtermNameInputMapVtyConfigurationErrorVtyMissingTermEnvVar defaultConfig userConfigoverrideEnvConfigstandardIOConfigparseConfigFilerunParseConfig$fGParseAltsV1$fGParseAlts:+:$fGParseAltsM1 $fGParseM1 $fGParse:*: $fGParseK1 $fGParseU1 $fGParseM10 $fParse[]$fParseModifier $fParseKey $fParseInt $fParseChar$fMonoidConfig $fExceptionVtyConfigurationError$fShowVtyConfigurationError$fEqVtyConfigurationError $fShowConfig $fEqConfigInput _eventChannel shutdownInput _configRef _inputDebuginputForConfigColorISOColorColor240blackredgreenyellowbluemagentacyanwhite brightBlack brightRed brightGreen brightYellow brightBlue brightMagenta brightCyan brightWhitergbColorStyle MaybeDefaultDefault KeepCurrentSetTo FixedAttr fixedStylefixedForeColorfixedBackColorAttr attrStyle attrForeColor attrBackColorstandout underline reverseVideoblinkdimbolddefaultStyleMask styleMaskhasStyle withForeColor withBackColor withStyledefAttr currentAttr$fMonoidMaybeDefault $fMonoidAttr $fEqFixedAttr$fShowFixedAttr$fEqAttr $fShowAttr $fReadAttr$fReadMaybeDefault$fShowMaybeDefault$fEqMaybeDefaultStyleStateChange ApplyStandoutRemoveStandoutApplyUnderlineRemoveUnderlineApplyReverseVideoRemoveReverseVideo ApplyBlink RemoveBlinkApplyDim RemoveDim ApplyBold RemoveBoldDisplayColorDiffColorToDefault NoColorChangeSetColorDisplayAttrDiff styleDiffs foreColorDiff backColorDifffixDisplayAttrsimplifyStyleDiffssimplifyColorDiffsdisplayAttrDiffs diffColor diffStyles$fMonoidDisplayAttrDiff$fShowDisplayColorDiff$fEqDisplayColorDiff$fShowStyleStateChange$fEqStyleStateChange$fShowDisplayAttrDiffwcwidthwcswidth safeWcwidth safeWcswidthImage DisplayText imageWidth imageHeight horizJoinvertJoin DisplayRegion regionWidth regionHeightbackgroundFill<|><->horizCatvertCattexttext'chariso10646Stringstring utf8Stringutf8Bytestringutf8Bytestring'charFill emptyImagepad translate translateX translateYcrop cropBottom cropRightcropLeftcropTopresize resizeWidth resizeHeight ImageEndoImageOpImageConstructEventImageConstructLogforwardImageOpsforwardTransformreverseTransform debugImageOps idImageOp BackgroundClearBackgroundbackgroundCharbackgroundAttrCursorNoCursorAbsoluteCursorPicture picCursor picLayers picBackground emptyPictureaddToTop addToBottom picForImage picForLayerspicImage$fNFDataBackground$fNFDataCursor$fNFDataPicture $fShowPicture DisplayOpsSpanOpsSpanOpTextSpanSkipRowEnd textSpanAttrtextSpanOutputWidthtextSpanCharWidth textSpanTextdropOps splitOpsAtdisplayOpsColumnsdisplayOpsRowsaffectedRegionspanOpsEffectedColumnsspanOpHasWidthcolumnsToCharOffset $fShowSpanOp $fEqSpanOp MockWindowSpanConstructEvent SpanSetAttrSpanConstructLogrowOpsEffectedColumnsallSpansHaveWidthspanOpsEffectedRows isSetAttrregionForWindow$fShowMockWindow$fEqMockWindow BlitState _columnOffset _rowOffset _skipColumns _skipRows_remainingColumns_remainingRowsMSpanOpsMRowOpsBlitEnv_region_mrowOps columnOffsetremainingColumns remainingRows rowOffset skipColumnsskipRowsBlitMmrowOpsregiondisplayOpsForPicdisplayOpsForImagecombinedOpsForLayerssubstituteSkips mergeUnder mergeRowUnder swapSkipsForSingleColumnCharSpanswapSkipsForCharSpan buildSpansstartImageBuild isOutOfBoundsaddMaybeClippedaddMaybeClippedJoinaddUnclippedTextaddRowCompletionsnocOp-~+~DisplayContext contextDevice contextRegionwriteMoveCursorwriteShowCursorwriteHideCursor writeSetAttrwriteDefaultAttr writeRowEnd AssumedState prevFattr prevOutputOpsOutput terminalIDreleaseTerminalreserveDisplayreleaseDisplay displayBoundsoutputByteBuffercontextColorCountsupportsCursorVisibility supportsModesetMode getModeStatusassumedStateRefmkDisplayContextringTerminalBell supportsBellModeMouseBracketedPastedisplayContextinitialAssumedState outputPicturelimitAttrForDisplay$fEqMode $fReadMode $fShowModeMockData mockTerminalreserveTerminaloutputForConfig setCursorPos hideCursor showCursorVtyupdate nextEvent inputIface outputIfacerefreshshutdownmkVtywithVtyInlineM backColor foreColor applyStyle removeStyle defaultAll putAttrChangeputAttrChange_navKeys0navKeys1navKeys2navKeys3 functionKeys1 functionKeys2 classifyTableghc-prim GHC.TypesTruebracketedPasteStartbracketedPasteEnd takeUntil isSGREvent sgrPrefix isNormalEvent normalPrefixshiftBitmetaBitctrlBit buttonMask leftButton middleButton rightButton hasBitSet getSGRButton getModifiersclassifyNormalMouseEventclassifySGRMouseEventcompileclassify classifyUtf8 utf8Length unix-2.7.2.0System.Posix.IO.CommonstdInput stdOutputdirectory-1.2.6.2System.DirectorygetAppUserDataDirectory GParseAlts gparseAltsGParsegparseParse parseValueconfigLanguage configLexermapDecl debugLogDecl ignoreLine parseConfig genericParse InputBuffer_ptr_size configRef eventChannel inputDebug InputState_unprocessedBytes_appliedConfig _inputBuffer _classifierptrsizeInputM setTermTiming appliedConfig classifier inputBufferunprocessedByteslogMsgloopInputProcessoraddBytesToProcessemitreadFromDevice applyConfig parseEvent dropInvalidrunInputProcessorLoopattributeControllogInitialInputState initInput forkOSFinally<>=<>~ HorizText HorizJoinVertJoinBGFill CropRightCropLeft CropBottomCropTop EmptyImage displayText outputWidth charWidth outputHeightleftSkiptopSkipppImageStructure $fMonoidImageattrpartLeft partRightpartTop partBottom croppedImageclipText $fNFDataImage $fShowImagebaseGHC.BaseStringCursorOutputMap writeUtf8TextcharToOutputPoswriteOutputOps writeSpanOps writeSpanOpcursorOutputMapcursorColumnOffset BuildResults outParamCount outCapOps outParamOps BuildState nextOffset CapParserParamOp IncFirstTwoParamOpsCapOpBytesDecOutCharOut PushParam PushValue Conditional BitwiseOr BitwiseXOr BitwiseAnd ArithPlus ArithMinus CompareEq CompareLt CompareGtconditionalExprconditionalPartsCapOpsCapParam CapExpressioncapOpscapBytes sourceString paramCountparamOpsparseCapExpressionconstructCapExpressioncapExpressionParserparamEscapeParserliteralPercentParser paramOpParserincrementOpParser pushOpParser decOutParser charOutParserconditionalOpParserconditionalTrueParserconditionalFalseParserconditionalEndParserbitwiseOpParserbitwiseOrParserbitwiseAndParserbitwiseXorParser arithOpParserliteralIntOpParsercompareOpParser bytesOpParsercharConstParser incOffsetinitialBuildState$fMonoidBuildResults$fNFDataParamOp $fNFDataCapOp$fNFDataCapExpression$fShowCapExpression$parsec-3.1.11-37j7M1YEHqtEooY7BpJdriText.Parsec.Error ParseError EvalStateEval evalStackevalExpression evalParamspop readParampush applyParamOps applyParamOp writeCapExpr writeCapOps writeCapOpDisplayAttrSeqterminfoWriteSetAttransiColorIndex altColorIndexDisplayAttrState applyStandoutapplyUnderlineapplyReverseVideo applyBlinkapplyDim applyBold EnterExitSeqSetStateDisplayAttrCaps setAttrStates enterStandout exitStandoutenterUnderline exitUnderlineenterReverseVideo enterDimMode enterBoldMode TerminfoCapssmcuprmcupcupcnormcivissupportsNoColorsuseAltColorMap setForeColor setBackColorsetDefaultAttr clearScreenclearEoldisplayAttrCaps ringBellAudioc_getWindowSize fdWriteAllsendCapToTerminal requireCapprobeCapparseCapcurrentDisplayAttrCaps getWindowSizeterminfoDisplayContextsgrArgsForStatereqDisplayCapSeqFor stateForStylestyleToApplySeqenableBracketedPastesdisableBracketedPastessetUtf8CharSetsetDefaultCharSetxtermInlineHack utf8ActiveintMkVty GHC.IORefIORef globalVty globalOutput mkDupeConfig withOutput utf8FromIsoppUtf8