enum

TermBuf::Input::Prefix

Inherits Enum < Comparable < Value < Object

What an escape sequence begins with, which is the only part of it whose meaning is fixed by the standards rather than by whoever wrote the terminal.

Everything after the introducer is private to the sequence, so a pattern says which introducer it is interested in and matches the rest by hand.

Constants

CSI = 0

ESC [, a control sequence.

SS3 = 1

ESC O, the application keypad form.

DCS = 2

ESC P, a device control string.

APC = 3

ESC _, an application programming command, which is where the kitty graphics protocol lives.

OSC = 4

ESC ], an operating system command.

PM = 5

ESC ^, a privacy message.

SOS = 6

ESC X, a start of string.

Other = 7

ESC and one more byte, which is everything else.

Constructors

from_introducer(byte : Char) : Prefix

What introducer byte names, the byte after the escape.

Source

Class methods

split(prefix : String) : Tuple(Prefix, String)

Splits a written prefix such as "\e[?" into the introducer it names and whatever it wants to see straight after it.

This is what lets a driver's expect-response API keep taking a string: an application that knows what a mode report looks like should not have to know how this shard files it.

Source

Instance methods

apc?

Returns true if this enum value equals APC

Source
csi?

Returns true if this enum value equals CSI

Source
dcs?

Returns true if this enum value equals DCS

Source
introducer_size

How many bytes the introducer takes, which is where the body starts.

Source
osc?

Returns true if this enum value equals OSC

Source
other?

Returns true if this enum value equals Other

Source
pm?

Returns true if this enum value equals PM

Source
sos?

Returns true if this enum value equals SOS

Source
ss3?

Returns true if this enum value equals SS3

Source
string?

Whether the sequence runs to a string terminator rather than to a byte in the final range, which is what decides whether Sequence#final means anything.

Source