terminal

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package terminal provides terminal input, scrolling, and raw-mode lifecycle primitives independently of router state and pane composition.

Index

Constants

View Source
const (
	PaneWheelUp   byte = 0x80
	PaneWheelDown byte = 0x81
)

Variables

This section is empty.

Functions

func PaneScroll

func PaneScroll(key byte, offset, rows, total int) (next int, follow, handled bool)

Shared scroll offsets and default diff follow policy. Transcript consumers resume at the last full viewport and own their follow-key bindings.

func PaneWheelKey

func PaneWheelKey(action byte) byte

func SupportsFaint

func SupportsFaint(ctx context.Context, mode string) (bool, error)

SupportsFaint applies an invocation-local override or checks this process's ancestors for mosh-server. Detached multiplexers may hide that ancestry; their callers can explicitly choose off. Unrelated sessions are never scanned.

func WithRawPane

func WithRawPane(ctx context.Context, stdin, stdout *os.File, enter, leave string, body func(<-chan byte) error) (err error)

WithRawPane owns raw mode, screen setup, and a cancellable key reader for a router pane. The reader is joined before terminal state is restored.

Types

type Mouse

type Mouse struct {
	Active  bool
	Payload string
	// contains filtered or unexported fields
}

SGR mouse reports can span reads. Consume the whole report, including ignored clicks and malformed payloads, so its bytes never become review commands.

func (*Mouse) Consume

func (m *Mouse) Consume(key byte) (action byte, row, column int)

Jump to

Keyboard shortcuts

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