Bytes of an escape sequence that arrived without their continuation.
A terminal is free to split ESC [ A across two reads, and a decoder
that forgot the ESC between calls would report a stray escape and
then the letter A. This carries the fragment across.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=PENDING_CAPACITY), | private | :: | buffer | = | "" |
Fixed store, so a |
|
| integer(kind=default_int), | private | :: | length | = | 0_default_int |
Bytes in use. |
Forget any partial escape sequence.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(pending_t), | intent(inout) | :: | this |
Whether a partial sequence is being carried.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(pending_t), | intent(in) | :: | this |
type :: pending_t !! Bytes of an escape sequence that arrived without their continuation. !! !! A terminal is free to split `ESC [ A` across two reads, and a decoder !! that forgot the `ESC` between calls would report a stray escape and !! then the letter A. This carries the fragment across. private character(len=PENDING_CAPACITY) :: buffer = "" !! Fixed store, so a `pending_t` needs no allocation and can be a !! plain component of a caller's state. integer(default_int) :: length = 0_default_int !! Bytes in use. contains procedure :: clear => pending_clear procedure :: is_empty => pending_is_empty end type pending_t