Documentation
¶
Index ¶
- Variables
- type ExitFocusMsg
- type ExitMsg
- type OutputMsg
- type Pane
- func (p *Pane) ExitErr() error
- func (p *Pane) GetContent() string
- func (p *Pane) GetWorkdir() string
- func (p *Pane) HandleKey(msg tea.KeyMsg) tea.Msg
- func (p *Pane) HandleMouse(msg tea.MouseMsg)
- func (p *Pane) ID() string
- func (p *Pane) IsAltScreenActive() bool
- func (p *Pane) Running() bool
- func (p *Pane) ScrollbackLen() int
- func (p *Pane) SetSessionName(name string)
- func (p *Pane) SetSize(width, height int)
- func (p *Pane) SetWorkdir(dir string)
- func (p *Pane) Size() (width, height int)
- func (p *Pane) Start(command string, args ...string) tea.Cmd
- func (p *Pane) Stop() error
- func (p *Pane) StopGraceful(timeout time.Duration) error
- func (p *Pane) Update(msg tea.Msg) tea.Cmd
- func (p *Pane) View() string
- func (p *Pane) ViewportOffset() int
- func (p *Pane) WriteInput(data []byte) (int, error)
- type Position
- type RenderTickMsg
- type ScrollbackBuffer
- func (sb *ScrollbackBuffer) Capacity() int
- func (sb *ScrollbackBuffer) Clear()
- func (sb *ScrollbackBuffer) Get(index int) []vt10x.Glyph
- func (sb *ScrollbackBuffer) GetRange(startIndex, endIndex int) [][]vt10x.Glyph
- func (sb *ScrollbackBuffer) Len() int
- func (sb *ScrollbackBuffer) Push(line []vt10x.Glyph)
- type SelectionMode
- type SelectionState
- func (s *SelectionState) Bounds() (start, end Position)
- func (s *SelectionState) Clear()
- func (s *SelectionState) Contains(pos Position) bool
- func (s *SelectionState) ExtractText(scrollbackLines [][]vt10x.Glyph, liveScreen func(col, row int) vt10x.Glyph, ...) string
- func (s *SelectionState) Finish()
- func (s *SelectionState) IsActive() bool
- func (s *SelectionState) Start(pos Position)
- func (s *SelectionState) Update(pos Position)
Constants ¶
This section is empty.
Variables ¶
var ErrPaneNotRunning = fmt.Errorf("pane is not running")
Functions ¶
This section is empty.
Types ¶
type Pane ¶
type Pane struct {
// contains filtered or unexported fields
}
func (*Pane) GetContent ¶
GetContent returns the current terminal content as plain text for analysis.
func (*Pane) GetWorkdir ¶
func (*Pane) HandleMouse ¶
func (*Pane) IsAltScreenActive ¶ added in v0.0.37
IsAltScreenActive returns whether the terminal is in alternate screen mode.
func (*Pane) ScrollbackLen ¶ added in v0.0.37
ScrollbackLen returns the number of lines in the scrollback buffer.
func (*Pane) SetSessionName ¶ added in v0.0.26
SetSessionName sets the session name for OPENKANBAN_SESSION env var
func (*Pane) SetWorkdir ¶
SetWorkdir sets the working directory for commands
func (*Pane) StopGraceful ¶
StopGraceful sends SIGTERM, waits for timeout, then SIGKILL if needed.
func (*Pane) ViewportOffset ¶ added in v0.0.37
ViewportOffset returns how many lines the viewport is scrolled back.
type Position ¶ added in v0.0.37
type Position struct {
Row int // Logical row (negative = scrollback, positive = live screen)
Col int
}
Position represents a coordinate in the terminal.
type RenderTickMsg ¶
type RenderTickMsg struct {
PaneID string
}
RenderTickMsg triggers a throttled render
type ScrollbackBuffer ¶ added in v0.0.37
type ScrollbackBuffer struct {
// contains filtered or unexported fields
}
ScrollbackBuffer is a ring buffer for storing terminal scrollback history. It stores lines that have scrolled off the top of the terminal screen.
func NewScrollbackBuffer ¶ added in v0.0.37
func NewScrollbackBuffer(capacity int) *ScrollbackBuffer
NewScrollbackBuffer creates a new scrollback buffer with the given capacity.
func (*ScrollbackBuffer) Capacity ¶ added in v0.0.37
func (sb *ScrollbackBuffer) Capacity() int
Capacity returns the maximum number of lines the buffer can hold.
func (*ScrollbackBuffer) Clear ¶ added in v0.0.37
func (sb *ScrollbackBuffer) Clear()
Clear removes all lines from the buffer.
func (*ScrollbackBuffer) Get ¶ added in v0.0.37
func (sb *ScrollbackBuffer) Get(index int) []vt10x.Glyph
Get returns the line at the given index (0 = oldest line in buffer). Returns nil if index is out of bounds.
func (*ScrollbackBuffer) GetRange ¶ added in v0.0.37
func (sb *ScrollbackBuffer) GetRange(startIndex, endIndex int) [][]vt10x.Glyph
GetRange returns lines from startIndex to endIndex (exclusive). Useful for rendering a viewport of scrollback history.
func (*ScrollbackBuffer) Len ¶ added in v0.0.37
func (sb *ScrollbackBuffer) Len() int
Len returns the number of lines in the buffer.
func (*ScrollbackBuffer) Push ¶ added in v0.0.37
func (sb *ScrollbackBuffer) Push(line []vt10x.Glyph)
Push adds a line to the scrollback buffer. If the buffer is full, the oldest line is overwritten.
type SelectionMode ¶ added in v0.0.37
type SelectionMode int
SelectionMode represents the current state of text selection.
const ( SelectionIdle SelectionMode = iota SelectionSelecting SelectionSelected )
type SelectionState ¶ added in v0.0.37
type SelectionState struct {
Mode SelectionMode
Anchor Position // Where selection started (click position)
Cursor Position // Current end of selection (drag position)
}
SelectionState manages mouse text selection in the terminal.
func NewSelectionState ¶ added in v0.0.37
func NewSelectionState() *SelectionState
NewSelectionState creates a new selection state in idle mode.
func (*SelectionState) Bounds ¶ added in v0.0.37
func (s *SelectionState) Bounds() (start, end Position)
Bounds returns the normalized selection bounds (start before end).
func (*SelectionState) Clear ¶ added in v0.0.37
func (s *SelectionState) Clear()
Clear cancels any active selection.
func (*SelectionState) Contains ¶ added in v0.0.37
func (s *SelectionState) Contains(pos Position) bool
Contains checks if a position is within the selection.
func (*SelectionState) ExtractText ¶ added in v0.0.37
func (s *SelectionState) ExtractText( scrollbackLines [][]vt10x.Glyph, liveScreen func(col, row int) vt10x.Glyph, liveRows int, scrollbackLen int, ) string
ExtractText extracts selected text from scrollback buffer and live screen. scrollbackLines: lines from scrollback buffer (oldest first) liveScreen: function to get a glyph from live screen (col, row) liveRows: number of rows in live screen scrollbackLen: total lines in scrollback
func (*SelectionState) Finish ¶ added in v0.0.37
func (s *SelectionState) Finish()
Finish completes the selection (mouse release).
func (*SelectionState) IsActive ¶ added in v0.0.37
func (s *SelectionState) IsActive() bool
IsActive returns true if there's an active or completed selection.
func (*SelectionState) Start ¶ added in v0.0.37
func (s *SelectionState) Start(pos Position)
Start begins a new selection at the given position.
func (*SelectionState) Update ¶ added in v0.0.37
func (s *SelectionState) Update(pos Position)
Update extends the selection to the new cursor position.