class TermBuf::ResponseRegistry

Overview

The patterns an application is currently waiting on.

Empty by default, which is the useful default: with nothing registered every escape sequence arriving from the terminal is something the person at the keyboard pressed.

Guarded, because the reader runs on a thread of its own when the terminal is a real device while registration happens wherever the application is.

Defined in:

termbuf/terminal/responses.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def clear : Nil #

Stops expecting anything.


[View source]
def empty? : Bool #

Whether nothing is expected, in which case every sequence is input.


[View source]
def matches?(sequence : String) : Bool #

Whether sequence is one of the replies being waited for.


[View source]
def register(prefix : String, terminator : String) : ResponsePattern #

Starts expecting pattern. Registering the same one twice is harmless.


[View source]
def register(pattern : ResponsePattern) : ResponsePattern #

Starts expecting pattern. Registering the same one twice is harmless.


[View source]
def size : Int32 #

How many patterns are registered.


[View source]
def unregister(pattern : ResponsePattern) : Nil #

Stops expecting pattern.


[View source]