limits

package
v0.0.0-...-4aa4c59 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const BytesPerBuffer = MaxBytesPerRune * RunesPerLine // Max bytes per 1 line

BytesPerBuffer defines the maximum number of bytes in a buffer used for reading/writing terminal control/data byte sequences.

View Source
const LinesPerHistory = 0

LinesPerHistory defines the maximum number of lines stored in history. Old lines are discarded as more than LinesPerHistory are added.

By omitting build tag "history", you can disable the line history capability, and as a result eliminate nearly all unessential statically-allocated memory in Terminal objects.

This may be desirable for use cases where only a single line of input is being read (e.g., password prompt, complex user dialog), or when the package is being used strictly for its terminal emulation to manipulate the cursor or display (line drawing, progress meter, interactive menu, etc.).

View Source
const MaxBytesPerKey = 2 * MaxBytesPerRune // TBD: Is there a _correct_ value?

MaxBytesPerKey defines the maximum number of bytes in a key code sequence. This is the size of the buffer used for parsing each key from an I/O buffer.

This buffer must be large enough to hold the byte sequence of a single key code sequence; it need not hold an entire escape sequence consisting of multiple key codes.

Note that this probably isn't large enough for every possible valid key code byte sequence, but we need to place a reasonable upper bound on this space.

Using escape.go as reference (github.com/ardnew/embedit/seq/ansi), the widest sequence recognized appears to be 6 bytes.

View Source
const MaxBytesPerRune = utf8.UTFMax

maxBytesPerRune defines the maximum number of bytes in a UTF-8 encoded rune.

View Source
const RunesPerLine = 256

RunesPerLine defines the maximum number of runes in a line of input.

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL