tuicast

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

tuicast

tuicast

Table of Contents

Background

  • Goal
    • To create a TUI automation framework, allowing you to control a terminal based application programatically. Use cases for such a framework include:
      • End-to-end (E2E) testing - simulate a real user flow and assert the app behaves correctly
      • Automation - expose a surface for terminal applications to be integrated into automated workflows

TUICast makes terminal-based applications testable and automatable through reliable, programmatic control of interactive terminal sessions. It abstracts connection protocols and terminal behavior so engineers can interact with legacy TUIs using deterministic, modern automation APIs.

  • Background and problem
    • Some enterprise systems still use interactive terminal interfaces over SSH or Telnet. Automating them can be challenging because they are stateful screen applications rather than command-line programs:
      • Output arrives incrementally.
      • Escape sequences update an existing screen.
      • Input includes special keys, not just text.
      • Applications often provide no explicit "ready" signal.
      • Tests may need hundreds of isolated, concurrent sessions.
    • TUICast provides one abstraction over those concerns.
  • Intended users
    • Engineers testing legacy enterprise TUI applications
    • Teams integrating terminal-only systems into automated workflows
    • Test-tool and SDK authors
    • AI agents or orchestration systems that need controlled TUI access
  • Primary use cases
    • End-to-end testing: Perform realistic user workflows and assert screen contents, cursor position, or other terminal state.
    • Business-process automation: Integrate terminal-only applications into larger workflows.
    • Concurrency and load scenarios: Run many independent users or sessions simultaneously.
    • Observability and diagnostics: Capture terminal state and failures in a form test tools can report.
    • Language-neutral integration: Control TUICast through its driver and language SDKs.
    • AI-assisted operation: Expose a constrained terminal automation surface through MCP
  • Glossary

What's In This Project?

                                        ┌┈┈┈┈┈┈┈┈┈┈┈┈┈┐
                                 ┌─────▶┊ Your TUI    ┊
╔════════╗         ╔════════╗    │ ┌───▶┊ Application │
║  SDKs  ║◀───────▶║ Driver ║◀───┘ │    └┈┈┈┈┈┈┈┈┈┈┈┈┈┘
╚════════╝         ║        ║◀───┐ │
                   ╚════════╝    │ │    ╔═════════════╗
                                 └─│───▶║ Reference   ║
┌┈┈┈┈┈┈┈┈┐         ╔════════╗      │ ┌─▶║  TUI App    ║
┊ Your   ┊◀───────▶║  MCP   ║◀─────┘ │  ╚═════════════╝
┊ Agents ┊         ║ Server ║◀───────┘
└┈┈┈┈┈┈┈┈┘         ╚════════╝
The Driver (Required)

The driver is the central piece to this project. It manages all the connections to the TUI applications being automated and/or tested, as well as all the sessions for each connection. For SSH connections, it authenticates using the password or private key you supply and verifies the server's host key.

The driver exposes a JSON-RPC protocol that your application will use to:

  • Open SSH and Telnet connections and terminal sessions.
  • Send text, named keystrokes, and raw bytes, including escape sequences, to the TUI applications.
  • Read the current screen, wait for expected screen content or for output to go idle, and subscribe to screen updates and terminal events such as BELL and ENQ.

The driver is a binary that must be installed and available on your PATH when using TUICast. The JSON-RPC protocol allows for communication with the driver from a variety of programming languages.

Go programs can also embed the TUICast library directly, without the driver.

The SDKs

Rather than writing your own code directly against the JSON-RPC protocol supported by the driver, we provide SDKs to make it easier to write your tests or automation code to interact with the driver. Currently, SDKs are provided in Go, Java, Python, and Typescript.

The MCP Server (Optional)

The MCP server included in this project will allow you to connect the driver to any AI tools you may be using. Via the MCP server, an AI agent can utilize the driver to connect to a TUI application, gather information about the current state of the application, and interact with the application.

There is a separate installation for the MCP server so that you can install it (or not) in accordance with your AI policies.

The Reference TUI Application (Optional)

A reference TUI application is maintained as part of this project. This application can be used during demonstrations rather than connecting to a real production application. It is also used as part of integration testing of this project, so we have a standardized application that can be used for deterministic tests. As new use cases are covered by this project, the reference TUI application can be updated to include functionality that will allow for testing and demonstration of any new functionality.

Installation

SDK

The SDK launches tuicast-driver, so install that separately and make sure it is available on your PATH.

Go

To install the SDK for Go, use go get.

go get github.com/castingcode/tuicast/sdk/go@latest

Then in your code, import the SDK as:

import tuicast "github.com/castingcode/tuicast/sdk/go"
Driver and Other Binaries (reference tui application)
Homebrew
brew install --cask castingcode/tap/tuicast
WinGet
winget install --exact --id CastingCode.TUICast
Scoop
scoop bucket add castingcode https://github.com/castingcode/scoop-bucket.git
scoop install castingcode/tuicast

These packages install tuicast-driver, tuicast-mcp, and reference-tui.

Using the install script

The default destination is ./bin. Add the selected directory to PATH if necessary.

macOS and Linux

Install the driver into ./bin:

curl --proto '=https' --tlsv1.2 -LsSf \
  https://github.com/castingcode/tuicast/releases/latest/download/install.sh | sh

Install the reference TUI:

curl --proto '=https' --tlsv1.2 -LsSf \
  https://github.com/castingcode/tuicast/releases/latest/download/install.sh |
  sh -s -- --component reference-tui

Install everything into ~/.local/bin:

curl --proto '=https' --tlsv1.2 -LsSf \
  https://github.com/castingcode/tuicast/releases/latest/download/install.sh |
  sh -s -- --component all --bin-dir "$HOME/.local/bin"

Install a specific version:

curl --proto '=https' --tlsv1.2 -LsSf \
  https://github.com/castingcode/tuicast/releases/latest/download/install.sh |
  sh -s -- --component driver v0.0.1
Windows PowerShell

Install the driver:

$install = [scriptblock]::Create((irm `
  https://github.com/castingcode/tuicast/releases/latest/download/install.ps1))

& $install -Component driver

Reference TUI:

& $install -Component reference-tui

Everything in a chosen directory:

& $install -Component all -BinDir "$HOME\bin"

Specific version:

& $install -Component driver -Version v0.0.1
Using npm

Install the driver and reference TUI globally on macOS, Linux, or Windows:

npm install --global @castingcode/tuicast-cli

The installer selects the release for the current operating system and CPU, downloads tuicast-driver and reference-tui, and verifies their SHA-256 checksums. This package is separate from the @castingcode/tuicast TypeScript SDK.

Linux packages

Each GitHub release includes deb, rpm, and apk packages containing tuicast-driver, tuicast-mcp, and reference-tui. Download the package for your CPU architecture from the release and install it with the platform package manager, for example:

sudo apt install ./tuicast_VERSION_linux_amd64.deb
Using Go install

Alternatively, you can use go install to install the binaries. Ensure $GOBIN or $GOPATH/bin is on PATH, as the SDK will launch the driver.

To install, run:

go install github.com/castingcode/tuicast/cmd/tuicast-driver@latest

The reference TUI and MCP server also support go install:

go install github.com/castingcode/tuicast/cmd/reference-tui@latest
go install github.com/castingcode/tuicast/cmd/tuicast-mcp@latest

Running the Reference TUI

The reference TUI is a deterministic terminal application for demonstrations, integration tests, and exercising TUICast automation.

Configure credentials

The reference TUI has no default passwords, modeling how credentials should be handled for real WMS environments. From the repository root, copy .env.example to .env.local, which Git ignores, choose your own passwords, and load both environment files into your shell:

cp .env.example .env.local    # then set the passwords in .env.local
set -a; . ./.env; . ./.env.local; set +a
Variable Purpose
TUICAST_REFERENCE_PASSWORD SSH password; required with --ssh-address
TUICAST_REFERENCE_APP_PASSWORD Password accepted by the application's login screen, at most 24 characters; always required

The SSH and application user IDs default to operator. For ease of demonstration, the login screen displays the configured application credentials. The examples and getting-started guides read the same variables. Without a checkout, export the two variables directly.

Run interactively
reference-tui

Use Ctrl-C to exit.

Serve over SSH
reference-tui --ssh-address 127.0.0.1:2222

Connect from another terminal:

ssh -tt \
  -o PreferredAuthentications=password \
  -o PubkeyAuthentication=no \
  operator@127.0.0.1 -p 2222

Authenticate as operator with the value of TUICAST_REFERENCE_PASSWORD.

Use -ssh-username and -app-username to change the user IDs. The -ssh-password and -app-password flags are also available, but prefer the environment variables because command-line arguments are visible to other local users.

To accept several SSH users, supply -ssh-users-file with the path to a JSON file mapping user names to passwords, such as {"operator":"...","supervisor":"..."}. Keep that file out of version control.

To use a stable SSH host key:

reference-tui \
  -ssh-address 127.0.0.1:2222 \
  -ssh-host-key ./host-key

These credentials are intended for local demonstrations and testing, not production use.

Serve over Telnet
reference-tui -telnet-address 127.0.0.1:2323

Connect from another terminal:

telnet 127.0.0.1 2323

The SSH and Telnet address options are mutually exclusive. Start separate processes when both protocols are needed.

Run VTTEST scenarios

The reference application can launch the external vttest utility from its menu. Install it separately and ensure it is on PATH:

brew install vttest

On Linux, install vttest through your distribution’s package manager.

Running CI Checks Locally

The Taskfile runs the same checks as the CI pipeline. Install Task, then run all jobs or one at a time:

task ci          # every job below, in order
task check       # Go formatting, vet, tests, Go examples, and the npm CLI installer
task java        # Java SDK and examples (requires Maven and Java 21)
task typescript  # TypeScript SDK and examples
task python      # Python SDK and examples (requires Python 3.12)

Run task to list the individual steps. The example tests start the reference TUI on the addresses in .env; set different addresses in .env.local if those ports are busy. As in CI, each run generates fresh passwords unless .env.local provides them.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnswerbackTerminal

type AnswerbackTerminal interface {
	SetAnswerback(string) error
}

AnswerbackTerminal configures the response sent when the host transmits ENQ.

type Attributes

type Attributes uint16

Attributes describes a cell's graphic rendition.

const (
	Bold Attributes = 1 << iota
	Underline
	Blink
	Reverse
	Conceal
)

func (Attributes) Has

func (a Attributes) Has(attributes Attributes) bool

Has reports whether all requested attributes are set.

type Cell

type Cell struct {
	Text       string
	Width      int
	Foreground Color
	Background Color
	Attributes Attributes
}

Cell is one terminal screen cell. Text is normally one character. Width is one for a normal cell, two for a wide character, and zero for its continuation.

type Color

type Color int16

Color is a terminal palette index. DefaultColor selects the terminal's configured default foreground or background.

const (
	Black Color = iota
	Red
	Green
	Yellow
	Blue
	Magenta
	Cyan
	White
)
const (
	DefaultColor Color = -1
)

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

Connection is a server-managed connection to a remote terminal server.

func (*Connection) Close

func (c *Connection) Close() error

Close closes every session and then the underlying connection. It is idempotent.

func (*Connection) ID

func (c *Connection) ID() uint64

ID returns the connection's server-unique identifier.

func (*Connection) NewSession

func (c *Connection) NewSession(ctx context.Context, terminal Terminal) (*Session, error)

NewSession opens and starts an interactive session on the connection.

type Connector

type Connector interface {
	Connect(context.Context) (SessionOpener, error)
}

Connector establishes a connection capable of opening terminal sessions.

type Cursor

type Cursor struct {
	Column  int
	Row     int
	Visible bool
}

Cursor is a zero-based cursor position and its visibility state.

type CursorMatcherSpec added in v0.1.0

type CursorMatcherSpec struct {
	Column int `json:"column"`
	Row    int `json:"row"`
}

CursorMatcherSpec describes CursorAt.

type FlightRecord added in v0.2.0

type FlightRecord struct {
	Type     FlightRecordType
	Offset   time.Duration
	Data     []byte
	Revision uint64
	Width    int
	Height   int
}

FlightRecord is one entry in a flight recording. Offset is measured from the session start. Output records carry Data and the screen Revision after the terminal applied it; resize records carry Width and Height.

type FlightRecordType added in v0.2.0

type FlightRecordType string

FlightRecordType identifies an entry in a flight recording.

const (
	// FlightOutput is one read of host output, recorded exactly as received.
	FlightOutput FlightRecordType = "output"
	// FlightResize is a change of terminal dimensions.
	FlightResize FlightRecordType = "resize"
)

type FlightRecording added in v0.2.0

type FlightRecording struct {
	Profile      TerminalProfile
	Start        time.Time
	Captured     time.Duration
	Width        int
	Height       int
	DroppedBytes uint64
	Records      []FlightRecord
	Unsupported  []UnsupportedSequence
}

FlightRecording is a detached copy of a session's most recent host output, up to 64 KiB, kept so a failed wait can be traced back to the bytes that produced its last screen. Width and Height are the dimensions in effect before the first record. DroppedBytes counts earlier output no longer retained, so a replay of a recording with dropped bytes starts mid-stream.

type Key

type Key string

Key identifies a named terminal key or one printable character.

const (
	KeyEnter     Key = "Enter"
	KeyTab       Key = "Tab"
	KeyBackspace Key = "Backspace"
	KeyEscape    Key = "Escape"
	KeyUp        Key = "ArrowUp"
	KeyDown      Key = "ArrowDown"
	KeyRight     Key = "ArrowRight"
	KeyLeft      Key = "ArrowLeft"
	KeyHome      Key = "Home"
	KeyEnd       Key = "End"
	KeyInsert    Key = "Insert"
	KeyDelete    Key = "Delete"
	KeyPageUp    Key = "PageUp"
	KeyPageDown  Key = "PageDown"
	KeyF1        Key = "F1"
	KeyF2        Key = "F2"
	KeyF3        Key = "F3"
	KeyF4        Key = "F4"
	KeyF5        Key = "F5"
	KeyF6        Key = "F6"
	KeyF7        Key = "F7"
	KeyF8        Key = "F8"
	KeyF9        Key = "F9"
	KeyF10       Key = "F10"
	KeyF11       Key = "F11"
	KeyF12       Key = "F12"
)

type KeyEncoder

type KeyEncoder interface {
	EncodeKey(Key) ([]byte, error)
}

KeyEncoder converts named keys to the byte sequence expected by a terminal profile. Terminal implementations may satisfy this in addition to Terminal.

type KeyModifier

type KeyModifier uint8

KeyModifier identifies modifiers applied to a key press. Alt and Meta are aliases because ANSI terminals conventionally encode both as an Escape prefix or the same CSI modifier bit.

const (
	ModifierShift KeyModifier = 1 << iota
	ModifierAlt
	ModifierControl

	ModifierMeta = ModifierAlt
)

type KeyPress

type KeyPress struct {
	Key       Key
	Modifiers KeyModifier
}

KeyPress describes one key and its combined modifiers.

func NewKeyPress

func NewKeyPress(key Key, modifiers ...KeyModifier) (KeyPress, error)

NewKeyPress combines modifiers into one key press.

type LineMatcherSpec added in v0.1.0

type LineMatcherSpec struct {
	Row  int    `json:"row"`
	Text string `json:"text"`
}

LineMatcherSpec describes ScreenLineEquals.

type MatcherSpec added in v0.1.0

type MatcherSpec struct {
	Contains *string            `json:"contains,omitempty"`
	Line     *LineMatcherSpec   `json:"line,omitempty"`
	Cursor   *CursorMatcherSpec `json:"cursor,omitempty"`
	All      []MatcherSpec      `json:"all,omitempty"`
	Any      []MatcherSpec      `json:"any,omitempty"`
	Not      *MatcherSpec       `json:"not,omitempty"`
}

MatcherSpec is a serializable screen expectation used by the driver protocol, MCP tools, and recorded workflows. Exactly one field must be set.

func (MatcherSpec) ScreenMatcher added in v0.1.0

func (s MatcherSpec) ScreenMatcher() (ScreenMatcher, error)

ScreenMatcher builds the matcher described by s.

type ModifiedKeyEncoder

type ModifiedKeyEncoder interface {
	EncodeKeyPress(KeyPress) ([]byte, error)
}

ModifiedKeyEncoder converts key presses with modifiers to the byte sequence expected by a terminal profile.

type Screen

type Screen struct {
	Width    int
	Height   int
	Cells    []Cell
	Cursor   Cursor
	Revision uint64
	// Title is the window title most recently set by the host. It is empty
	// when the host has not set one or the terminal profile has no titles.
	Title string
}

Screen is a detached, row-major terminal snapshot. The Cells slice belongs to the snapshot and is never reused by the terminal that produced it.

func (Screen) CellAt

func (s Screen) CellAt(column, row int) (Cell, bool)

CellAt returns the cell at a zero-based position.

func (Screen) Line

func (s Screen) Line(row int) string

Line returns one row's text, including trailing spaces.

func (Screen) Text

func (s Screen) Text() string

Text returns every row joined by a newline. It preserves trailing spaces and does not append a newline after the final row.

type ScreenMatcher

type ScreenMatcher interface {
	Match(Screen) bool
}

ScreenMatcher determines whether a screen has reached an expected state.

func AllOf

func AllOf(matchers ...ScreenMatcher) ScreenMatcher

AllOf matches when every matcher succeeds. An empty AllOf matches every screen.

func AnyOf

func AnyOf(matchers ...ScreenMatcher) ScreenMatcher

AnyOf matches when at least one matcher succeeds. An empty AnyOf never matches.

func CursorAt

func CursorAt(column, row int) ScreenMatcher

CursorAt matches the cursor's zero-based position.

func Not

func Not(matcher ScreenMatcher) ScreenMatcher

Not matches when matcher does not succeed.

func ScreenContains

func ScreenContains(text string) ScreenMatcher

ScreenContains matches when the exact screen text contains text.

func ScreenLineEquals

func ScreenLineEquals(row int, text string) ScreenMatcher

ScreenLineEquals matches when row contains exactly text, including trailing spaces. Rows are zero-based.

type ScreenMatcherFunc

type ScreenMatcherFunc func(Screen) bool

ScreenMatcherFunc adapts a function into a ScreenMatcher.

func (ScreenMatcherFunc) Match

func (f ScreenMatcherFunc) Match(screen Screen) bool

Match calls the adapted function.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server owns terminal connection and session lifecycles.

func NewServer

func NewServer(logger *slog.Logger) (*Server, error)

NewServer creates a terminal server using logger for lifecycle events.

func (*Server) Close

func (s *Server) Close() error

Close closes all tracked sessions and connections. It is idempotent.

func (*Server) Connect

func (s *Server) Connect(ctx context.Context, connector Connector) (*Connection, error)

Connect establishes and tracks a transport connection.

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session coordinates one transport stream with one terminal.

func (*Session) Close

func (s *Session) Close() error

Close closes the stream and waits for its read loop to stop. It is idempotent.

func (*Session) Done

func (s *Session) Done() <-chan struct{}

Done is closed when the remote session ends or Close completes.

func (*Session) Err

func (s *Session) Err() error

Err returns the error that ended the session, if any.

func (*Session) Events

func (s *Session) Events(ctx context.Context) <-chan TerminalEvent

Events observes BELL, ENQ, and future non-screen terminal events. Each event has a session-monotonic sequence. A subscriber that cannot keep up is closed rather than blocking terminal processing.

func (*Session) EventsAfter added in v0.2.0

func (s *Session) EventsAfter(sequence uint64) []TerminalEvent

EventsAfter returns the session's retained events whose sequence numbers are greater than sequence, oldest first. A session retains its most recent 256 events, including events published before any Events subscriber existed or that a slow subscriber missed. Sequence numbers are contiguous, so a gap before the first returned event shows how many are no longer retained.

func (*Session) FlightRecording added in v0.2.0

func (s *Session) FlightRecording() FlightRecording

FlightRecording returns a detached copy of the session's most recent host output, up to 64 KiB, with the resizes between reads and the session's unsupported-sequence counts. Wait errors include one automatically.

func (*Session) ID

func (s *Session) ID() uint64

ID returns the session's server-unique identifier.

func (*Session) Press

func (s *Session) Press(key Key, modifiers ...KeyModifier) error

Press sends the terminal-profile sequence for a named or printable key with optional modifiers.

func (*Session) Resize

func (s *Session) Resize(width, height int) error

Resize changes both the local terminal and the remote session dimensions.

func (*Session) Screen

func (s *Session) Screen() Screen

Screen returns the terminal's current detached snapshot.

func (*Session) Screens

func (s *Session) Screens(ctx context.Context) <-chan Screen

Screens observes detached snapshots. It sends the current snapshot first, then the latest snapshot after each visible screen revision. A slow observer may skip intermediate revisions. The channel closes when ctx or the session ends.

func (*Session) Send

func (s *Session) Send(data []byte) error

Send writes input to the remote terminal session. Concurrent sends are serialized so their byte streams cannot interleave.

func (*Session) UnsupportedSequences added in v0.2.0

func (s *Session) UnsupportedSequences() []UnsupportedSequence

UnsupportedSequences returns the sequences the terminal has ignored in the order they first appeared, with the number of times each was received. A session counts at most 256 distinct sequences; later new sequences are neither counted nor reported.

func (*Session) WaitFor

func (s *Session) WaitFor(ctx context.Context, matcher ScreenMatcher) (Screen, error)

WaitFor waits until matcher accepts a screen, the context expires, or the session ends.

func (*Session) WaitForIdle

func (s *Session) WaitForIdle(ctx context.Context, quietPeriod time.Duration) (Screen, error)

WaitForIdle waits until no host output arrives for quietPeriod. Host bytes that do not visibly change the screen still reset the quiet period.

func (*Session) WaitForStable

func (s *Session) WaitForStable(ctx context.Context, matcher ScreenMatcher, quietPeriod time.Duration) (Screen, error)

WaitForStable waits until matcher succeeds and no host output arrives for quietPeriod. The matcher is checked again after the quiet period.

type SessionOpener

type SessionOpener interface {
	OpenSession(context.Context, SessionRequest) (SessionStream, error)
	Close() error
}

SessionOpener is the transport-specific side of a Connection.

type SessionRequest

type SessionRequest struct {
	TerminalType string
	Width        int
	Height       int
}

SessionRequest describes the terminal requested from a remote server.

type SessionStream

type SessionStream interface {
	io.ReadWriteCloser
	Resize(width, height int) error
}

SessionStream carries one interactive terminal session. Close must unblock any pending Read so session shutdown can complete.

type Terminal

type Terminal interface {
	io.Writer
	Profile() TerminalProfile
	Resize(width, height int) error
	Snapshot() Screen
}

Terminal consumes bytes received from a host and maintains terminal state. Implementations return detached snapshots that remain stable as more bytes are processed.

type TerminalEvent

type TerminalEvent struct {
	Sequence uint64
	Type     TerminalEventType
	Data     string
}

TerminalEvent reports a terminal control event. Sequence is assigned by the session. Data contains the configured answerback for an enquiry and the ignored sequence, such as "CSI ? 2004 h", for an unsupported event.

type TerminalEventDrainer

type TerminalEventDrainer interface {
	DrainEvents() []TerminalEvent
}

TerminalEventDrainer exposes events produced synchronously by Terminal.Write. The session drains events after each host-output write.

type TerminalEventType

type TerminalEventType string

TerminalEventType identifies a non-screen event emitted while processing host output.

const (
	EventBell    TerminalEventType = "bell"
	EventEnquiry TerminalEventType = "enquiry"
	// EventUnsupported reports host output that the terminal profile does not
	// implement and therefore ignored. A terminal emits one for every
	// occurrence; a session publishes only the first of each distinct
	// sequence and counts the rest (see Session.UnsupportedSequences).
	EventUnsupported TerminalEventType = "unsupported"
)

type TerminalProfile

type TerminalProfile string

TerminalProfile identifies the behavior emulated by a terminal.

const (
	// ProfileVT220 identifies the DEC VT220 terminal profile.
	ProfileVT220 TerminalProfile = "vt220"
	// ProfileXTerm identifies the xterm terminal profile with 256-color support.
	ProfileXTerm TerminalProfile = "xterm-256color"
)

type UnsupportedSequence added in v0.2.0

type UnsupportedSequence struct {
	Sequence string
	Count    uint64
}

UnsupportedSequence counts how often the host sent a sequence the terminal ignored. Sequence uses the notation of EventUnsupported data.

type WaitError

type WaitError struct {
	Expected   string
	LastScreen Screen
	Cause      error
	Recording  *FlightRecording
}

WaitError reports why a screen wait ended and retains the last observed snapshot for assertion diagnostics. Recording, when present, holds the host output that preceded the failure.

func (*WaitError) Error

func (e *WaitError) Error() string

func (*WaitError) Unwrap

func (e *WaitError) Unwrap() error

Unwrap returns the context or session error that ended the wait.

Directories

Path Synopsis
Package ansi provides shared ANSI/DEC terminal emulation for concrete terminal profiles.
Package ansi provides shared ANSI/DEC terminal emulation for concrete terminal profiles.
cmd
reference-tui command
tuicast-driver command
tuicast-mcp command
Package driver exposes TUICast through a language-neutral JSON-RPC protocol.
Package driver exposes TUICast through a language-neutral JSON-RPC protocol.
Package driverui provides the read-only TUICast Inspector HTTP application.
Package driverui provides the read-only TUICast Inspector HTTP application.
Package mcpserver exposes TUICast terminal automation as MCP tools.
Package mcpserver exposes TUICast terminal automation as MCP tools.
Package memory provides an in-memory transport for automation and tests.
Package memory provides an in-memory transport for automation and tests.
Package parsing converts a terminal byte stream into ANSI/DEC parser events.
Package parsing converts a terminal byte stream into ANSI/DEC parser events.
Package reference implements the deterministic TUI used to exercise TUICast automation and terminal emulation.
Package reference implements the deterministic TUI used to exercise TUICast automation and terminal emulation.
ssh
Package ssh serves the reference TUI over SSH.
Package ssh serves the reference TUI over SSH.
telnet
Package telnet serves the reference TUI over Telnet.
Package telnet serves the reference TUI over Telnet.
sdk
go module
Package ssh implements SSH transport using golang.org/x/crypto/ssh.
Package ssh implements SSH transport using golang.org/x/crypto/ssh.
Package telnet implements Telnet transport and option negotiation.
Package telnet implements Telnet transport and option negotiation.
Package trace encodes TUICast flight recordings as JSON-lines trace files.
Package trace encodes TUICast flight recordings as JSON-lines trace files.
Package vt220 implements the TUICast DEC VT220 terminal profile.
Package vt220 implements the TUICast DEC VT220 terminal profile.
Package workbench records and replays language-neutral terminal workflows.
Package workbench records and replays language-neutral terminal workflows.
Package xterm implements the TUICast xterm terminal profile.
Package xterm implements the TUICast xterm terminal profile.

Jump to

Keyboard shortcuts

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