~/bend-docscommunity

src/dev/escape.bend checks

raw source on the hub · import 0x2324e729258ea5021b37b97947af4c3f/src/dev/escape.bend as Escape

1 import
import Base

Types

type Esc source · line 11 · raw

Data

type Key source · line 14 · raw

Data

Definitions

def Esc.new source · line 22 · raw

@active:Bool -> Esc

def Esc.active source · line 25 · raw

@e:Esc -> Bool

def Key.bytes.new source · line 30 · raw

@+bs:List<&2, U32> -> @+ks:List<&2, Key> -> List<&2, Key>

def Key.bytes.on source · line 33 · raw

@+bs:List<&2, U32> -> @k:Key -> @rest:List<&2, Key> -> List<&2, Key>

def Key.bytes source · line 41 · raw

@+bs:List<&2, U32> -> @ks:List<&2, Key> -> List<&2, Key>

Prepends guest bytes, joining a KBytes that follows.

def Esc.act source · line 49 · raw

@+c:U32 -> Key

The key an armed escape makes of c: an action, or bytes.

def Esc.prepend source · line 56 · raw

@k:Key -> @ks:List<&2, Key> -> List<&2, Key>

def Esc.after source · line 64 · raw

@emit:List<&2, Key> -> @r:Pair(Esc, List<&2, Key>) -> Pair(Esc, List<&2, Key>)

The keys a step emits (none or one) before the rest's.

def Esc.feed.go source · line 69 · raw

@bs:List<&2, U32> -> @+active:Bool -> @+armed:Bool -> Pair(Esc, List<&2, Key>)

def Esc.feed source · line 80 · raw

@bs:List<&2, U32> -> @e:Esc -> Pair(Esc, List<&2, Key>)

Feeds a chunk of console input: the escape's state after it and the keys, in order.

def Esc.raw_input source · line 89 · raw

Bool

The terminal, when stdin is one: raw input (every key, Ctrl-C included, goes to the guest; the Ctrl-A keys above act on the VMM), and output still turns each newline into CR LF (the guest's console may send a bare LF). Restored when the VMM exits.

def Esc.out_crlf source · line 92 · raw

Bool