Documentation
¶
Index ¶
- Constants
- func ColourFrom24Bit(r, g, b string) (lipgloss.TerminalColor, error)
- func ColourFrom4Bit(code uint8) lipgloss.TerminalColor
- func ColourFrom8Bit(n string) (lipgloss.TerminalColor, error)
- func ColourFromAnsi(ansi []string, bg bool) (lipgloss.TerminalColor, error)
- func DefaultBackground() lipgloss.TerminalColor
- func DefaultForeground() lipgloss.TerminalColor
- type Annotation
- type Buffer
- func (buffer *Buffer) BottomMargin() uint
- func (buffer *Buffer) ClearHighlight()
- func (buffer *Buffer) ClearSelection()
- func (buffer *Buffer) CursorColumn() uint16
- func (buffer *Buffer) CursorLine() uint16
- func (buffer *Buffer) CursorLineAbsolute() uint16
- func (buffer *Buffer) ExtendSelectionToEntireLines()
- func (buffer *Buffer) FindWordAt(pos Position, runeMatcher RuneMatcher) (start Position, end Position, text string, textIndex int, found bool)
- func (buffer *Buffer) GetBoundedTextAtPosition(pos Position) (start Position, end Position, text string, textIndex int, found bool)
- func (buffer *Buffer) GetCell(viewCol uint16, viewRow uint16) *Cell
- func (buffer *Buffer) GetCursorShape() CursorShape
- func (buffer *Buffer) GetHighlightAnnotation() *Annotation
- func (buffer *Buffer) GetMaxLines() uint64
- func (buffer *Buffer) GetScrollOffset() uint
- func (buffer *Buffer) GetSelection() (string, *Selection)
- func (buffer *Buffer) GetVPosition() int
- func (buffer *Buffer) GetViewHighlight() (start Position, end Position, exists bool)
- func (buffer *Buffer) GetVisibleLines() []Line
- func (b *Buffer) GetVisibleSixels() []VisibleSixel
- func (buffer *Buffer) HasScrollableRegion() bool
- func (buffer *Buffer) Height() int
- func (buffer *Buffer) Highlight(start Position, end Position, annotation *Annotation)
- func (buffer *Buffer) InScrollableRegion() bool
- func (buffer *Buffer) InSelection(pos Position) bool
- func (buffer *Buffer) IsApplicationCursorKeysModeEnabled() bool
- func (buffer *Buffer) IsCursorVisible() bool
- func (buffer *Buffer) IsNewLineMode() bool
- func (buffer *Buffer) IsTabSetAtCursor() bool
- func (buffer *Buffer) RawLine() uint64
- func (buffer *Buffer) ScrollDown(lines uint)
- func (buffer *Buffer) ScrollToEnd()
- func (buffer *Buffer) ScrollUp(lines uint)
- func (buffer *Buffer) SelectWordAt(pos Position, runeMatcher RuneMatcher)
- func (buffer *Buffer) SetCursorShape(shape CursorShape)
- func (buffer *Buffer) SetScrollOffset(offset uint)
- func (buffer *Buffer) SetSelectionEnd(pos Position)
- func (buffer *Buffer) SetSelectionStart(pos Position)
- func (buffer *Buffer) TopMargin() uint
- func (buffer *Buffer) ViewHeight() uint16
- func (buffer *Buffer) ViewWidth() uint16
- func (buffer *Buffer) Width() uint16
- type Cell
- func (cell *Cell) Attr() CellAttributes
- func (cell *Cell) Bg() lipgloss.TerminalColor
- func (cell *Cell) Bold() bool
- func (cell *Cell) Dim() bool
- func (cell *Cell) Fg() lipgloss.TerminalColor
- func (cell *Cell) Italic() bool
- func (cell *Cell) Rune() MeasuredRune
- func (cell *Cell) Strikethrough() bool
- func (cell *Cell) Underline() bool
- type CellAttributes
- type Colour
- type CursorShape
- type Line
- type MeasuredRune
- type Modes
- type MouseExtMode
- type MouseMode
- type Option
- type Position
- type RuneMatcher
- type Selection
- type Sixel
- type Terminal
- func (t *Terminal) GetActiveBuffer() *Buffer
- func (t *Terminal) GetMouseExtMode() MouseExtMode
- func (t *Terminal) GetMouseMode() MouseMode
- func (t *Terminal) GetTitle() string
- func (t *Terminal) IsRunning() bool
- func (t *Terminal) Lock()
- func (t *Terminal) Pty() *os.File
- func (t *Terminal) Run(updateChan chan struct{}, rows uint16, cols uint16) error
- func (t *Terminal) SetSize(rows, cols uint16) error
- func (t *Terminal) SetWindowManipulator(m WindowManipulator)
- func (t *Terminal) Unlock()
- func (t *Terminal) Write(data []byte) (n int, err error)
- func (t *Terminal) WriteToPty(data []byte) error
- type VisibleSixel
- type WindowManipulator
- type WindowState
Constants ¶
View Source
const ( MouseModeNone MouseMode = iota MouseModeX10 MouseModeVT200 MouseModeVT200Highlight MouseModeButtonEvent MouseModeAnyEvent MouseExtNone MouseExtMode = iota MouseExtUTF MouseExtSGR MouseExtURXVT )
View Source
const ( MainBuffer uint8 = 0 AltBuffer uint8 = 1 InternalBuffer uint8 = 2 )
View Source
const TabSize = 8
Variables ¶
This section is empty.
Functions ¶
func ColourFrom24Bit ¶
func ColourFrom24Bit(r, g, b string) (lipgloss.TerminalColor, error)
func ColourFrom4Bit ¶
func ColourFrom4Bit(code uint8) lipgloss.TerminalColor
func ColourFrom8Bit ¶
func ColourFrom8Bit(n string) (lipgloss.TerminalColor, error)
func ColourFromAnsi ¶
func ColourFromAnsi(ansi []string, bg bool) (lipgloss.TerminalColor, error)
func DefaultBackground ¶
func DefaultBackground() lipgloss.TerminalColor
func DefaultForeground ¶
func DefaultForeground() lipgloss.TerminalColor
Types ¶
type Annotation ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
func NewBuffer ¶
func NewBuffer(width, height uint16, maxLines uint64, fg lipgloss.TerminalColor, bg lipgloss.TerminalColor) *Buffer
NewBuffer creates a new terminal buffer
func (*Buffer) BottomMargin ¶
func (*Buffer) ClearHighlight ¶
func (buffer *Buffer) ClearHighlight()
func (*Buffer) ClearSelection ¶
func (buffer *Buffer) ClearSelection()
func (*Buffer) CursorColumn ¶
Column returns cursor column
func (*Buffer) CursorLine ¶
CursorLine returns cursor line (in Origin Mode it is relative to the top margin)
func (*Buffer) CursorLineAbsolute ¶
CursorLineAbsolute returns absolute cursor line coordinate (ignoring Origin Mode) - view format
func (*Buffer) ExtendSelectionToEntireLines ¶
func (buffer *Buffer) ExtendSelectionToEntireLines()
func (*Buffer) FindWordAt ¶
func (buffer *Buffer) FindWordAt(pos Position, runeMatcher RuneMatcher) (start Position, end Position, text string, textIndex int, found bool)
returns raw lines
func (*Buffer) GetBoundedTextAtPosition ¶
func (*Buffer) GetCursorShape ¶
func (buffer *Buffer) GetCursorShape() CursorShape
func (*Buffer) GetHighlightAnnotation ¶
func (buffer *Buffer) GetHighlightAnnotation() *Annotation
func (*Buffer) GetMaxLines ¶
func (*Buffer) GetScrollOffset ¶
func (*Buffer) GetSelection ¶
func (*Buffer) GetVPosition ¶
func (*Buffer) GetViewHighlight ¶
func (*Buffer) GetVisibleLines ¶
func (*Buffer) GetVisibleSixels ¶
func (b *Buffer) GetVisibleSixels() []VisibleSixel
func (*Buffer) HasScrollableRegion ¶
func (*Buffer) Highlight ¶
func (buffer *Buffer) Highlight(start Position, end Position, annotation *Annotation)
takes raw coords
func (*Buffer) InScrollableRegion ¶
func (*Buffer) InSelection ¶
func (*Buffer) IsApplicationCursorKeysModeEnabled ¶
func (*Buffer) IsCursorVisible ¶
func (*Buffer) IsNewLineMode ¶
func (*Buffer) IsTabSetAtCursor ¶
func (*Buffer) ScrollDown ¶
func (*Buffer) ScrollToEnd ¶
func (buffer *Buffer) ScrollToEnd()
func (*Buffer) SelectWordAt ¶
func (buffer *Buffer) SelectWordAt(pos Position, runeMatcher RuneMatcher)
func (*Buffer) SetCursorShape ¶
func (buffer *Buffer) SetCursorShape(shape CursorShape)
func (*Buffer) SetScrollOffset ¶
func (*Buffer) SetSelectionEnd ¶
func (*Buffer) SetSelectionStart ¶
func (*Buffer) ViewHeight ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
func (*Cell) Attr ¶
func (cell *Cell) Attr() CellAttributes
func (*Cell) Bg ¶
func (cell *Cell) Bg() lipgloss.TerminalColor
func (*Cell) Fg ¶
func (cell *Cell) Fg() lipgloss.TerminalColor
func (*Cell) Rune ¶
func (cell *Cell) Rune() MeasuredRune
func (*Cell) Strikethrough ¶
type CellAttributes ¶
type CellAttributes struct {
// contains filtered or unexported fields
}
type Colour ¶
type Colour uint8
const ( ColourBlack Colour = iota ColourRed ColourGreen ColourYellow ColourBlue ColourMagenta ColourCyan ColourWhite ColourBrightBlack ColourBrightRed ColourBrightGreen ColourBrightYellow ColourBrightBlue ColourBrightMagenta ColourBrightCyan ColourBrightWhite ColourBackground ColourForeground ColourSelectionBackground ColourSelectionForeground ColourCursorForeground ColourCursorBackground )
See https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit
type CursorShape ¶
type CursorShape uint8
const ( CursorShapeBlinkingBlock CursorShape = iota CursorShapeDefault CursorShapeSteadyBlock CursorShapeBlinkingUnderline CursorShapeSteadyUnderline CursorShapeBlinkingBar CursorShapeSteadyBar )
type MeasuredRune ¶
type Modes ¶
type Modes struct { ShowCursor bool ApplicationCursorKeys bool BlinkingCursor bool ReplaceMode bool // overwrite character at cursor or insert new OriginMode bool // see DECOM docs - whether cursor is positioned within the margins or not LineFeedMode bool ScreenMode bool // DECSCNM (black on white background) AutoWrap bool SixelScrolling bool // DECSDM BracketedPasteMode bool }
type MouseExtMode ¶
type MouseExtMode uint
type Option ¶
type Option func(t *Terminal)
func WithInitialCommand ¶
func WithLogFile ¶
func WithWindowManipulator ¶
func WithWindowManipulator(m WindowManipulator) Option
type RuneMatcher ¶
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal communicates with the underlying terminal
func (*Terminal) GetActiveBuffer ¶
func (*Terminal) GetMouseExtMode ¶
func (t *Terminal) GetMouseExtMode() MouseExtMode
func (*Terminal) GetMouseMode ¶
func (*Terminal) SetWindowManipulator ¶
func (t *Terminal) SetWindowManipulator(m WindowManipulator)
func (*Terminal) WriteToPty ¶
type VisibleSixel ¶
type WindowManipulator ¶
type WindowManipulator interface { State() WindowState Minimise() Maximise() Restore() SetTitle(title string) Position() (int, int) SizeInPixels() (int, int) CellSizeInPixels() (int, int) SizeInChars() (int, int) ResizeInPixels(int, int) ResizeInChars(int, int) ScreenSizeInPixels() (int, int) ScreenSizeInChars() (int, int) Move(x, y int) IsFullscreen() bool SetFullscreen(enabled bool) GetTitle() string SaveTitleToStack() RestoreTitleFromStack() ReportError(err error) }
type WindowState ¶
type WindowState uint8
const ( StateUnknown WindowState = iota StateMinimised StateNormal StateMaximised )
Click to show internal directories.
Click to hide internal directories.