Tput
Inherits Tput::Input / Crystallabs::Helpers::Logging / Tput::Output / Tput::Output::Terminal / Tput::Macros / Crystallabs::Helpers::Alias_Methods / Tput::Output::Screen / Tput::Macros / Crystallabs::Helpers::Alias_Methods / Tput::Output::Mouse / Tput::Macros / Crystallabs::Helpers::Alias_Methods / Tput::Output::Rectangles / Tput::Macros / Crystallabs::Helpers::Alias_Methods / Tput::Output::Bell / Tput::Macros / Crystallabs::Helpers::Alias_Methods / Tput::Output::Colors / Tput::Macros / Crystallabs::Helpers::Alias_Methods / Tput::Output::Emulator / Tput::Macros / Crystallabs::Helpers::Alias_Methods / Tput::Output::Charset / Tput::Macros / Crystallabs::Helpers::Alias_Methods / Tput::Output::Scrolling / Tput::Macros / Crystallabs::Helpers::Alias_Methods / Tput::Output::Misc / Tput::Macros / Crystallabs::Helpers::Alias_Methods / Tput::Output::Text / Tput::Macros / Crystallabs::Helpers::Logging / Crystallabs::Helpers::Alias_Methods / Tput::Output::Cursor / Tput::Macros / Crystallabs::Helpers::Boolean / Crystallabs::Helpers::Alias_Methods / Crystallabs::Helpers::Logging / Tput::ACSC / Crystallabs::Helpers::Logging / Tput::Coordinates / Crystallabs::Helpers::Logging / Crystallabs::Helpers::Logging / JSON::Serializable / Tput::Namespace / Reference / Object
Many Tput methods correspond to terminal sequences. Often times methods are named according to their purpose, and then aliased to the names of sequences used behind the scenes.
For example, method #delete_columns is directly implemented using sequence decdc.
Therefore, it is also accessible under the alias #decdc.
Furthermore, for understanding the instructions on terminal sequences, the following names are important:
ESC - Sequence starting with ESC (\e)
CSI - Control Sequence Introducer: sequence starting with ESC [ (7bit) or CSI (\x9B, 8bit)
DCS - Device Control String: sequence starting with ESC P (7bit) or DCS (\x90, 8bit)
OSC - Operating System Command: sequence starting with ESC ] (7bit) or OSC (\x9D, 8bit)
C0: single byte command (7bit control codes, byte range \x00 .. \x1F, \x7F)
C1: single byte command (8bit control codes, byte range \x80 .. \x9F)
Some sequences accept arguments. Their naming and types correspond to those used in XTerm documentation:
Ps: A single (usually optional) numeric parameter, composed of one or more decimal digits.
Pm: A multiple numeric parameter composed of any number of single numeric parameters, separated by ";", e.g. ` Ps ; Ps ; … `.
Pt: A text parameter composed of printable characters.
In all of the examples above, spaces exist just for clarity and are not part of actual escape sequences. For example, in "ESC [" or " Ps ; Ps ;" there are no actual spaces.
Constants
Constructors
Instance methods
Outputs a string capability to the designated @output, if
the capability exists.
For this method to work, the Tput instance needs to be initialized with Terminfo data. If Terminfo data is not present, nil will be returned.
put &.smcup?
put &.cursor_pos?(10, 20)
Timeout when reading escape sequences. If an escape sequence (ESC) comes in on input, we have no way of telling whether this is an ESC key or the start of an escape sequence. So we read with a timeout. If there is no input by the time it times out, we consider it was a key press.
All other apps like Vi etc. read the escape key in the terminal this way.
The default timeout is 400 milliseconds, the same as in Qt.