Documentation
¶
Overview ¶
Package term is the integrated terminal panel: the user's shell on a PTY, screen state kept by a VT100 emulator (vt10x), rendered on demand. The app learns about new output via Notify (listen-cmd pattern, like lsp.Manager).
Index ¶
- type Term
- func (t *Term) Close()
- func (t *Term) Drag(x, y int)
- func (t *Term) Notify() <-chan struct{}
- func (t *Term) Paste(s string)
- func (t *Term) Press(x, y int)
- func (t *Term) Release(x, y int) string
- func (t *Term) Resize(cols, rows int)
- func (t *Term) Scroll(delta int)
- func (t *Term) Scrolled() int
- func (t *Term) Send(k tea.KeyMsg)
- func (t *Term) View(focused bool) string
- func (t *Term) Wheel(up bool, x, y int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Term ¶
type Term struct {
Label string // panel chip text; "" = numbered shell instance
// contains filtered or unexported fields
}
func New ¶
New starts argv (default: $SHELL, fallback /bin/sh) in dir on a cols×rows PTY. env entries ("K=V") are added to the inherited environment.
func (*Term) Notify ¶
func (t *Term) Notify() <-chan struct{}
Notify yields once per burst of output; closed when the shell exits.
func (*Term) Paste ¶ added in v0.16.0
Wheel handles one wheel step at cell (x, y) of the panel. Apps that asked for mouse reporting get a mouse code; alt-screen apps get arrow keys (xterm's alternate-scroll convention — how less/vim/htop scroll in real terminals); otherwise the view moves through Cove's scrollback. Paste writes s to the child as pasted input, the way a real terminal would: newlines become CR (what Enter sends), and if the child enabled bracketed paste (DECSET 2004) the text is wrapped in ESC[200~ / ESC[201~ so the app takes it as one block. Without the wrap, apps that rely on it (Claude Code, readline-based shells) see 1 KB chunks of "typed" text arriving through the PTY queue and mishandle every chunk but the last.
func (*Term) Release ¶ added in v0.6.1
Release ends the drag and returns the selected text; "" means a plain click (or the child app owns the mouse). The highlight stays until the next press.
func (*Term) Scroll ¶
Scroll moves the view into scrollback: positive = older lines, negative = toward the live screen. Clamped to available history.
func (*Term) Send ¶
Send encodes a key press as terminal input bytes and writes it to the PTY. Typing snaps the view back to the live screen.
Directories
¶
| Path | Synopsis |
|---|---|
|
Vendored from github.com/hinshun/vt10x (MIT, see LICENSE) with one Cove patch: primary-screen scrollback (history field in State, capture in scrollUp, HistoryLen/HistoryCell accessors, View interface additions).
|
Vendored from github.com/hinshun/vt10x (MIT, see LICENSE) with one Cove patch: primary-screen scrollback (history field in State, capture in scrollUp, HistoryLen/HistoryCell accessors, View interface additions). |