struct TermBuf::ResponsePattern

Overview

A reply the application is expecting from the terminal, described by what it starts and ends with.

This exists because a reply and a keystroke are not distinguishable by looking at them. An arrow key sends ESC [ A; so could a terminal. The only thing that separates them is that the application asked for one and not the other, which is what registering a pattern records.

Defined in:

termbuf/terminal/responses.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(prefix : String, terminator : String) #

[View source]

Instance Method Detail

def matches?(sequence : String) : Bool #

Whether sequence has this pattern's prefix and terminator.


[View source]
def prefix : String #

What the reply begins with, such as "\e[?" for a mode report.


[View source]
def terminator : String #

What the reply ends with, such as "$y".


[View source]
def to_s(io : IO) : Nil #
Description copied from struct Struct

Same as #inspect(io).


[View source]