terminal

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 16 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFeatures

func CheckFeatures(advertised []string) error

CheckFeatures verifies the ticket advertises every feature this client needs. Unknown extra features are tolerated; a missing required one is a definite pre-input refusal (exit 2).

func UsageNotice

func UsageNotice(daemonName, session string) string

func WatchResize

func WatchResize(stdout *os.File) (<-chan Size, func())

func WatchSignals

func WatchSignals() (<-chan os.Signal, func())

Types

type LockResponder added in v0.1.1

type LockResponder func(envelope string) (string, error)

LockResponder turns a lock_device_challenge envelope into a lock_device_proof envelope. It returns an error the caller surfaces verbatim, never a partial or an empty reply.

type Outcome

type Outcome struct {
	ExitCode int
	Detached bool
	Replaced bool
	// LockError carries the reason a protected workspace refused this attach,
	// so the caller reports the lock code rather than a generic close.
	LockError error
}

func Connect

func Connect(
	ctx context.Context,
	api *client.Client,
	daemonID string,
	session string,
	size Size,
	streams Streams,
) (Outcome, error)

func Run

func Run(ctx context.Context, connection *websocket.Conn, streams Streams) Outcome

type Restorer

type Restorer func() error

func EnterRaw

func EnterRaw(stdin *os.File) (Restorer, error)

type Size

type Size struct {
	Cols int
	Rows int
}

func Preflight

func Preflight(stdin, stdout *os.File, termName string) (Size, error)

type Streams

type Streams struct {
	Input   io.Reader
	Output  io.Writer
	Resize  <-chan Size
	Signals <-chan os.Signal
	// Lock answers a guest lock_device_challenge with the proof envelope for
	// this device's live grant. It is nil when no grant is stored, which is the
	// correct state for an open workspace and a definite refusal for a
	// protected one: the CLI never guesses a proof it cannot sign.
	Lock LockResponder
}

Jump to

Keyboard shortcuts

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