typist

package
v0.16.521 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0 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.

Documentation

Overview

Package typist types into an agent's tmux pane: it reads the screen before any key, decides whether a message may go in now, pastes its pictures and its text, presses Enter and watches the text leave the input box. It owns the pane lock, one per pane for the whole process, that every writer of a pane takes — v2's outbox and Legacy alike — so two of them never type into the same box. A hold has a term and a wait for it has one too (panelock.go): Write is the way in for everything that is not a message.

The package keeps no state of messages: it answers what one try did, and the caller decides what comes next. It reaches tmux only through Pane, so the tests run on screens from testdata and a fake clock.

Index

Constants

View Source
const (
	// HoldLimit is longer than the longest honest hold: a message with pictures typed into a loaded agent takes tens of
	// seconds, a dialog driven by keys about as much.
	HoldLimit = 2 * time.Minute
	// WaitLimit is how long LockContext waits for a pane when its context names no sooner end.
	WaitLimit = 45 * time.Second
	// ProbeLimit is how long the terminal server may take to answer before anything is typed: a server slower than
	// this takes each key later than the typist's own waits, and the keys of one message arrive apart.
	ProbeLimit = 2 * time.Second
)

The pane lock has two terms. A writer holds a pane for HoldLimit at most: past it the lock is let go for it, so a writer that hangs (a tmux that never answers, a wait that never ends) does not keep every other writer out for good. A writer waits for a pane for WaitLimit at most (or its context's end, whichever is first) and is told who is in the way, instead of hanging behind it.

View Source
const LongPromptText = 800

LongPromptText is the longest text Claude Code takes as typed; a longer typed burst reads as a paste too.

Variables

View Source
var (
	ErrHoldExpired = errors.New("typist: the hold of the pane ended at its term")
	ErrPreempted   = errors.New("typist: the pane was taken for the person's key")
)

ErrHoldExpired and ErrPreempted are why a writer's hold of a pane ended before the writer let it go: its term passed, or a writer that does not wait (the person's Stop) took the pane from it.

View Source
var (
	// ErrNotAtPrompt: the agent works, asks, or shows no input line, so a command typed now would go to the wrong place.
	ErrNotAtPrompt = errors.New("typist: the agent is not at its prompt")
	// ErrInputOccupied: the box holds text that is not the command's.
	ErrInputOccupied = errors.New("typist: the input box holds other text")
	// ErrCommandDeclined: the agent asked to confirm the change and the confirmation was answered "keep".
	ErrCommandDeclined = errors.New("typist: the agent kept the previous value")
	// ErrCommandRefused: the agent answered it will not do it (a model that does not take ultracode).
	ErrCommandRefused = errors.New("typist: the agent refused the command")
	// ErrCommandNotApplied: the command was typed and the screen never said it took effect.
	ErrCommandNotApplied = errors.New("typist: the agent did not confirm the command")
)
View Source
var ErrDialogStayed = errors.New("typist: the dialog is still on the screen")

ErrDialogStayed: the keys went in and the dialog is still on the screen.

View Source
var ErrMenuChanged = errors.New("typist: the menu on the screen is not the one decided on")

ErrMenuChanged: the menu on the screen is not the one the person decided on — another tool call asks, or the options differ — so no key was pressed.

View Source
var OnExpired func(pane string, held time.Duration)

OnExpired, when set, is told of a pane whose writer held it past HoldLimit: the lock was let go for it.

Functions

func Answer

func Answer(p Pane, c Clock, shapes []screen.QuestionShape, choices []screen.QuestionChoice) error

Answer types the answers of a question dialog, one group of keys per question, and waits for it to go.

func ChatAbout

func ChatAbout(p Pane, c Clock) bool

ChatAbout closes a question dialog by its "Chat about this" row; false when the row is not there or the dialog stayed.

func CheckGoldens

func CheckGoldens() []string

CheckGoldens reads every reference screen and returns what the reader got wrong, one line per screen; nil when it reads them all.

func ClearOwn

func ClearOwn(p Pane, c Clock, provider wire.Provider, text string, pictures bool, paths ...string) bool

ClearOwn empties Claude's box of text — what it holds must be a piece of text (with pictures: picture references of ours too), else nothing is pressed — row by row with ctrl+u, a reference ctrl+u leaves by Backspace, looking after every key: it stops as soon as the box holds anything that is not ours (the person started typing). Never while Claude still reads a paste of pictures: their references would land after the keys. True when the box ended empty. paths are picture paths of ours the box may hold besides (pasted, read late): they are cleared with the text.

func CountImageRefs

func CountImageRefs(text string) int

CountImageRefs counts the `[Image #n]` references in a text, wrapped ones too.

func DrawnCommand added in v0.16.15

func DrawnCommand(plain string) string

DrawnCommand is the shell command the permission dialog on a plain screen draws, its wrapped lines joined by newlines as drawn ("" when no command box is found). A gate made from the screen alone (the prompt of a background agent: no call of the chat's own is pending) shows it and checks the menu against it before a key goes in.

func DrawnPlan added in v0.16.86

func DrawnPlan(plain string) string

DrawnPlan is the plan as Claude's plan dialog draws it, between its dashed rules; "" when they are off the screen.

func DrawnPlanFile added in v0.16.86

func DrawnPlanFile(plain string) string

DrawnPlanFile is the name of the plan file Claude's plan dialog names under ~/.claude/plans; "" when it names none.

func DrawsCommand

func DrawsCommand(plain, summary, cwd string) bool

DrawsCommand: the permission dialog on the screen asks about exactly this shell command (a summary «$ cmd»), whole and alone in its box. False for a call whose summary is no shell command, and for a screen with no command box.

func EscapePathForPrompt

func EscapePathForPrompt(path string) string

EscapePathForPrompt puts a backslash before the characters an agent's prompt would read specially in a pasted path.

func Expired

func Expired() int64

Expired counts the holds that ended by their term.

func HarnessLeftover

func HarnessLeftover(s Screen, provider wire.Provider) bool

HarnessLeftover: the box holds nothing but a setting command of the harness.

func Hold

func Hold(ctx context.Context, pane string) (held context.Context, unlock func(), err error)

Hold is LockContext for a writer that types more than one key: held is the hold's context — it ends when the writer lets go, at HoldLimit (ErrHoldExpired) or when the pane is taken from it (ErrPreempted) — and the writer's keys are to be bound to it.

func Interrupt

func Interrupt(p Pane, c Clock) error

Interrupt presses Escape once; a key that did not go in is pressed again, interruptTries in all.

func IsSlow

func IsSlow(err error) bool

IsSlow says the error is a write put off because the terminal server answers too slowly.

func Lock

func Lock(pane string) (unlock func())

Lock takes the pane's lock, waiting for the writer that holds it; unlock lets it go and is safe to call twice.

func LockContext

func LockContext(ctx context.Context, pane string) (unlock func(), err error)

LockContext takes the pane's lock like Lock, but waits no longer than ctx and WaitLimit let it: a *BusyError says the pane stayed with another writer, and nothing is held.

func Locks

func Locks() int

Locks is how many panes have a lock held or waited for now.

func NewImageRefs

func NewImageRefs(before, now string) int

NewImageRefs counts the references on a screen that the earlier one did not have, reference by reference: older ones that scrolled away meanwhile do not hide new ones, and a number shown again after a reset counts once more.

func OptionLabel

func OptionLabel(line string) string

OptionLabel is a menu line's text without its number: "2. Yes, and don't ask again" → "Yes, and don't ask again".

func Pasting

func Pasting(plain string) bool

Pasting: the footer under the box says Claude is still reading a paste.

func PathLeftover

func PathLeftover(s Screen, provider wire.Provider, paths []string) bool

PathLeftover: the box holds nothing but picture paths the harness pasted (escaped as pasted, or bare; the box wraps them anywhere), with picture references among them or not — a paste the typist gave up on that landed later.

func PermissionModeNow

func PermissionModeNow(p Pane) (string, bool)

PermissionModeNow is the mode Claude's footer says now, ok false when it cannot be read.

func Pick

func Pick(p Pane, c Clock, provider wire.Provider, want PickWant) error

Pick presses the chosen option of a permission or a plan menu and waits for the menu to go. It looks at the screen first, under the lock the caller holds: a menu that changed since the person decided (another tool call, other options) gets no key, because the number would approve what they did not see.

func Preempt

func Preempt(pane string) (held context.Context, unlock func())

Preempt takes the pane at once, from whoever holds it: the holder's context ends with ErrPreempted — its keys stop there, the one under way is cut short — and the pane is the caller's. It is for the person's own key that must not wait behind a message being typed: Stop.

func SetEffort

func SetEffort(p Pane, c Clock, effort wire.Effort) error

SetEffort types «/effort level» and waits for «Set effort level to level». Since Claude Code 2.1.310 a level leaves ultracode as it is.

func SetFast

func SetFast(p Pane, c Clock, on bool) error

SetFast types «/fast on|off» and waits for «Fast mode ON» or «Fast mode OFF». A model or an account without the mode answers «Fast mode is not available …»: ErrCommandRefused.

func SetModel

func SetModel(p Pane, c Clock, id string) error

SetModel types «/model id» and waits for «Set model to»; Claude's «Switch model?» question is the person's consent already (the page asked), so its focused "Yes" is pressed.

func SetPermissionMode

func SetPermissionMode(p Pane, c Clock, mode string) error

SetPermissionMode turns Claude's permission mode (screen.ClaudeMode*) with shift+tab, one press at a time, each read back off the footer under the box, until the footer says the mode asked for. A mode the cycle does not have (a Claude started without --allow-dangerously-skip-permissions has no bypass in it) is gone round to the mode it started in and ends in ErrCommandRefused, the agent left as it was; a press the footer does not show ends in ErrCommandNotApplied.

func SetProfileModel

func SetProfileModel(p Pane, c Clock, id, label string) error

SetProfileModel checks the external model or its catalogue label. A reply for another gateway alias must never acknowledge this switch, even when both share an upstream ID.

func SetUltracode

func SetUltracode(p Pane, c Clock, on bool) error

SetUltracode types «/effort ultracode on|off» and waits for «Ultracode on (…)» or «Ultracode off.». A model or a setup that cannot run it answers «Ultracode isn't available on …»: ErrCommandRefused.

func Shows added in v0.16.5

func Shows(s Screen, want PickWant) error

Shows reports whether the screen shows the menu the person decided on — the check Pick makes before it presses a key (ErrMenuChanged when it does not). The runtime asks it of an open gate as the screen changes, so a card whose menu cannot be matched says so at once and not after a press that did nothing.

func StillInBox

func StillInBox(s Screen, provider wire.Provider, text string) bool

StillInBox: the box still holds text, the message's start (Claude: the whole box, its wrapped lines and wrapped picture references too; Codex: its prompt box).

func SubmitsAsTypedLine

func SubmitsAsTypedLine(text string) bool

SubmitsAsTypedLine: a line Claude Code takes as typed and submits on an Enter right behind it — short and single, not opening a mode with its first character (! shell, # memory, / command, & background) and not ending in an @ or / word, where Claude's completion list is open and would take the Enter.

func TryLock

func TryLock(pane string) (unlock func(), ok bool)

TryLock takes the pane's lock when nobody holds it; ok false otherwise, and nothing is held.

func TypedLeftover added in v0.16.24

func TypedLeftover(s Screen, provider wire.Provider, texts []string) string

TypedLeftover is the earlier message of ours the box holds what is left of (its paths and references aside): its start, or a piece of it pieceMin long at least. "" when the box is not that.

func Wipe added in v0.16.24

func Wipe(p Pane, c Clock, provider wire.Provider) bool

Wipe empties the box whatever it holds — only on the person's word («Очистить поле и отправить»), never by itself: Claude's row by row with ctrl+u (Backspace for a reference ctrl+u leaves), Codex's by ctrl+u. Never ctrl+c: in a working agent it interrupts the turn. True when the box ended empty.

func Write

func Write(ctx context.Context, server any, pane string, write func(held context.Context) error) error

Write is how anything but a message puts keys into a pane: write runs with the pane's lock held, after the terminal server answered in time, and is given the hold's context to bind its keys to. server is what the keys go through; one that is a Responder is asked first, and a slow answer is a *SlowError with nothing typed. A pane of "" is nobody's: write runs as it is.

func WriteNow

func WriteNow(pane string, write func(held context.Context) error) error

WriteNow is Write for the person's key that does not wait: the pane is taken from the writer that holds it (Preempt), and the key goes in without asking the server how fast it is.

Types

type Binder

type Binder interface {
	Bind(held context.Context) Pane
}

Binder is a Pane whose keys can be bound to a hold: the pane it returns types nothing once held has ended, and a key under way then is cut short.

type BusyError

type BusyError struct {
	Pane   string
	Waited time.Duration
	// Cause is the context's error when it ended the wait, nil when WaitLimit did.
	Cause error
}

BusyError is a pane another writer holds: the wait for it ended, nothing was typed.

func (*BusyError) Error

func (e *BusyError) Error() string

func (*BusyError) Unwrap

func (e *BusyError) Unwrap() error

type Clock

type Clock interface {
	Now() time.Time
	Sleep(d time.Duration)
}

Clock is time for a try: now and a sleep that tests make instant.

type Decision

type Decision string

Decision is whether a message may be typed now.

const (
	DecideSend        Decision = "send"
	DecideWait        Decision = "wait"
	DecideBlockedMenu Decision = "blocked-menu"
	DecideBlockedText Decision = "blocked-text"
)

func Deliverable

func Deliverable(s Screen) Decision

Deliverable decides from the screen: nothing readable or no input line, or a working agent → wait; a menu (it would take the keys as an answer) → blocked-menu; text in the box (it would go along with ours) → blocked-text; else send.

type DialogGrower added in v0.16.86

type DialogGrower interface {
	GrowForDialog() bool
}

DialogGrower is a pane whose window can grow for a dialog that does not fit. GrowForDialog answers true when the window grew and the program had time to redraw.

type Golden

type Golden struct {
	Provider wire.Provider
	Version  string
	Name     string
	Want     func(Screen) string
}

Golden is one reference screen and what the reader must see on it ("" from Want: it does).

func Goldens

func Goldens() []Golden

Goldens are the reference screens of the self-test.

type LineTyper added in v0.15.46

type LineTyper interface {
	TypeOnly(text string) error
}

LineTyper is a pane that can type a line's keys without its Enter: the typist then presses the Enter once the box has read the line to its end (a loaded Claude reads a burst of keys as a paste, slowly).

type MenuKind string

MenuKind is what the menu on a screen asks.

const (
	NoMenu         MenuKind = ""
	MenuQuestion   MenuKind = "question"   // Claude's AskUserQuestion dialog
	MenuPermission MenuKind = "permission" // a tool permission prompt
	MenuPlan       MenuKind = "plan"       // the plan approval prompt
	MenuOther      MenuKind = "other"      // any other numbered choice block (a picker, a trust dialog)
)

type Message

type Message struct {
	Text   string
	Images []string
	// Steer types into a working agent: its turn takes the text (Claude queues it until the next step). A menu or
	// foreign text still stops it.
	Steer bool
	// HandOver: the running tool is one Claude can hand to the background (Bash, an MCP call), so a steered message
	// goes in now by Claude's chord instead of waiting for the tool to end.
	HandOver bool
	// HandOverOK, when set, is asked right before the chord: the tool may have ended while the text was typed, and then
	// the chord would cut the model's answer short instead of handing a call over. Nil: go ahead.
	HandOverOK func() bool
	// Agent: another agent wrote the message. A question the agent asks is the person's to answer: the message waits
	// for the dialog to close and is never typed in as the reply.
	Agent bool
	// EnterOnly: a restart found the text in the box; only its Enter is pressed, and a box without it types nothing.
	EnterOnly bool
	// ClearOnly: the message is not to be sent but taken out of the box, where an earlier try left it (it stalled):
	// Sent when the box no longer holds it, BlockedText when it could not be cleared, Wait when it was not there.
	ClearOnly bool
	// Leftovers are the picture paths the harness pasted for its messages (this one's and earlier ones'). Claude reads
	// a big picture late: a paste the typist gave up on lands after it, as path text, and is ours to clear.
	Leftovers []string
	// Typed are the texts of the earlier messages the harness typed (not this one's): what is left of one in the box,
	// its paths and references aside, is ours to clear.
	Typed []string
	// Wipe: the person said to clear the box and send («Очистить поле и отправить»): text in the box that is not ours
	// is taken out too, row by row, and the message goes.
	Wipe bool
}

Message is what one try types: pictures (absolute paths) before the text.

type NativeOwner

type NativeOwner interface{ NativeAgentAlive() bool }

NativeOwner is checked immediately before each native write. A recognized input frame alone is never sufficient: a crashed CLI may have returned the pane to sh.

type Outcome

type Outcome string

Outcome is how one try ended.

const (
	// Sent: the text left the input box (or the screen could not be read to say otherwise) — not yet accepted. An
	// empty box is not delivery: the agent's prompt-submit hook or the message's entry in the transcript is, and the
	// caller waits for one of them.
	Sent Outcome = "sent"
	// Wait: no input line or a working agent; nothing was typed.
	Wait Outcome = "wait"
	// BlockedMenu, BlockedText: a menu or someone else's text; nothing was typed.
	BlockedMenu Outcome = "blocked-menu"
	BlockedText Outcome = "blocked-text"
	// Failed: a paste or a key did not go in, or a picture did not show up. Nothing reached the agent for sure: the
	// next try finds what did reach the box as its own and types only the rest.
	Failed Outcome = "failed"
	// Stuck: typed, Entered three times, still in the box.
	Stuck Outcome = "stuck"
)

type Pane

type Pane interface {
	// CaptureStyled is the pane with its styles, Capture without; false when it cannot be read.
	CaptureStyled() (string, bool)
	Capture() (string, bool)
	// Paste puts text in as one bracketed paste, without submitting it.
	Paste(text string) error
	// TypeLine types a short line as keys with its Enter right behind it.
	TypeLine(text string) error
	// Keys sends tmux key names in one go, in order.
	Keys(keys ...string) error
}

Pane is one agent pane in tmux.

type PickWant

type PickWant struct {
	// N is the option's number (1-based) and Label its text without the number, as the screen showed them.
	N     int
	Label string
	// Plan: the menu is a plan's approval, not a tool's permission.
	Plan bool
	// Dialog: the menu is one no tool call named, known by its heading and options. A permission or a plan is never one:
	// a label like «Yes» says nothing of what it approves.
	Dialog bool
	// Request is a dialog's heading, as the gate showed it.
	Request            string
	CredentialPromptID string
	// Command is the tool call the permission asks about ("" for a plan, or when the gate did not know it).
	Command string
	// Cwd is the session's working directory: the one a «cd <dir> &&» of the command may be left out for.
	Cwd string
}

PickWant is the menu a person decided on and the option they chose, as the gate showed them.

type Plan

type Plan struct {
	Decision Decision
	Landed   int
	OwnText  bool
	// Nothing: an Enter-only try finds the box without its text — there is nothing left to type.
	Nothing bool
	// ChatAbout: the question dialog is to be closed by «Chat about this» before the text goes in as the answer.
	ChatAbout bool
	// Dismiss: a screen the person left open in the terminal (/login, /model) is closed by Esc first.
	Dismiss screen.Aside
	// Clear: the box holds a setting command of the harness that did not go through, or picture paths the harness
	// pasted that never became pictures, or what is left of an earlier message of ours; it is cleared first, with its
	// picture references when ClearRefs.
	Clear     string
	ClearRefs bool
	// Wipe: the box holds text not of ours, and the message says to clear it all the same (Message.Wipe).
	Wipe bool
}

Plan is what one look at the screen lets a message do: the decision, and what of the message the box holds already from an earlier try — Landed of its pictures, or its text (OwnText).

func Decide

func Decide(m Message, s Screen, provider wire.Provider) Plan

Decide reads a look for a message, as Type does before any key: the outbox asks it first so a try the screen would refuse is not started at all.

func (Plan) Own

func (p Plan) Own() bool

Own: the box holds some of the message already.

type Prober

type Prober interface {
	Responsive() error
}

Prober is a Pane that can say the same of itself; Type asks it before the first key.

type Responder

type Responder interface {
	Responsive(pane string) error
}

Responder is a terminal server that can say whether it answers in time for a pane: nil when it does, an error when it took longer than ProbeLimit.

type Result

type Result struct {
	Outcome Outcome
	Before  Screen
	// Typed: keys went in (Sent, Stuck, a Failed after the first key). Own: the box held this message's pictures or
	// text from an earlier try, and only the rest was typed. ChatAbout: the question dialog was closed first.
	Typed, ChatAbout, HandedOver bool
	// Cleared: the screen the person left over the box (their /login, a picker) was closed by Esc first.
	Cleared screen.Aside
	Own     bool
	// AsPath: Claude did not show a picture as a reference, and the message went with its path as text.
	AsPath bool
	// Wiped: the box held text not of ours, and the person's word cleared it (Message.Wipe).
	Wiped bool
	// Slow: the terminal did not answer in ProbeLimit, and the try ended before its first key (Wait).
	Slow bool
	// Lost: the try's hold of the pane ended under it (TypeHeld): it stopped where it was, and whatever it typed is
	// not a delivery.
	Lost bool
	Err  error
}

Result is one try: its outcome, the screen it started from, and what it did on the way.

func Type

func Type(m Message, provider wire.Provider, p Pane, c Clock) Result

Type tries one message once: it reads the screen, closes a question dialog by «Chat about this» when the text is the person's answer in words, decides whether it may type now, and types what the box does not hold yet. The caller holds the pane's lock.

func TypeChecked

func TypeChecked(m Message, provider wire.Provider, p Pane, c Clock) Result

TypeChecked is Type for a CLI whose version the screen reading was checked against, and its cautious form for one it was not (cliversion.Cautious). On an unchecked version the reader may take one screen for another, so no key is pressed on the strength of a guess:

  • a screen read as the person's left-open picker or as a question dialog is not closed (no Esc, no «Chat about this»): the message waits as blocked by a menu, and the person answers the card or the terminal;
  • a box that reads empty after the Enter is not taken as proof that Claude queued the text: the chord that hands the running tool to the background is not pressed. Whether the agent took the message is said by its hook and its transcript, as for every message.

Everything else — what is typed, when it waits, how it is confirmed — is Type's.

func TypeHeld

func TypeHeld(lock string, m Message, provider wire.Provider, p Pane, c Clock) Result

TypeHeld is TypeChecked (Type, or its cautious form for an unchecked CLI version) under the pane's lock: it takes the lock, binds the pane's keys to the hold and types. A hold that ended under the try (the person's Stop took the pane, or its term passed) ends the try there: nothing more is typed, and the result says Lost — the message was not delivered by this try and keeps its place.

type Screen

type Screen struct {
	Readable bool
	Plain    string
	Busy     bool
	Menu     MenuKind
	// Panel: a TUI panel or picker is open over the box (Claude's /effort slider, its /model picker).
	Panel bool
	// Aside: one of those the person left open (Claude's /login, /model, /effort), which Esc closes safely.
	Aside   screen.Aside
	Options []string // the menu's options as the screen shows them
	// Request is what the menu asks, its heading on the screen.
	Request string
	// CredentialPromptID binds a local choice to the credential hint drawn in this prompt. It never leaves the runtime.
	CredentialPromptID string

	Input     string
	InputLine bool
	Box       string
	Pictures  int
	// OnlyPictures: the box holds picture references and nothing else.
	OnlyPictures bool
	// Queued: Claude shows messages waiting in its own queue (a steered message not handed over yet).
	Queued bool
	// Word: the reply Claude is writing, off the screen, while it works (empty: none shown).
	Word string
	// contains filtered or unexported fields
}

Screen is one look at an agent's pane. Input is meaningful only with InputLine; Box is the whole input box (its wrapped lines too), Pictures the [Image #n] references in it, OnlyPictures that it holds nothing else.

func Look

func Look(p Pane, provider wire.Provider) Screen

Look reads the pane; a pane that cannot be read is a Screen that is not Readable. A permission dialog too tall for the window has its top off the screen and out of the scrollback (Claude draws it on the alternate screen), so the call in it cannot be read whole: the pane grows when it can, and the look reads the dialog as redrawn.

func Read

func Read(styled string, provider wire.Provider) Screen

Read classifies a styled capture of an agent's pane.

func (Screen) Cut added in v0.16.86

func (s Screen) Cut() bool

Cut: the menu shows only the options that fit.

func (Screen) PromptReady

func (s Screen) PromptReady() bool

PromptReady: the agent shows an input line and is not working.

func (Screen) StartupPicker

func (s Screen) StartupPicker() bool

StartupPicker recognizes a menu or an active picker footer below the cursor. A stale footer higher in the terminal history does not consume an otherwise ready input box.

type SlowError

type SlowError struct {
	Pane  string
	Cause error
}

SlowError is a terminal server that did not answer in ProbeLimit: nothing was typed, the write is to be tried later.

func (*SlowError) Error

func (e *SlowError) Error() string

func (*SlowError) Unwrap

func (e *SlowError) Unwrap() error

type SystemClock

type SystemClock struct{}

SystemClock is the real clock.

func (SystemClock) Now

func (SystemClock) Now() time.Time

func (SystemClock) Sleep

func (SystemClock) Sleep(d time.Duration)

type TallCapturer added in v0.16.86

type TallCapturer interface {
	CaptureTall(short string) (string, bool)
}

TallCapturer is a pane with a terminal attached, whose size it may change only for a moment: CaptureTall is the styled screen at a size a dialog fits in. short is the screen now, as the look read it; false leaves that as it is.

Jump to

Keyboard shortcuts

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