Documentation
¶
Index ¶
- Constants
- 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
- 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) Pty() *os.File
- func (t *Terminal) Run(c *exec.Cmd, 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) Theme() *Theme
- func (t *Terminal) Write(data []byte) (n int, err error)
- func (t *Terminal) WriteToPty(data []byte) error
- type Theme
- func (t *Theme) ColourFrom24Bit(r, g, b string) (tcell.Color, error)
- func (t *Theme) ColourFrom4Bit(code uint8) tcell.Color
- func (t *Theme) ColourFrom8Bit(n string) (tcell.Color, error)
- func (t *Theme) ColourFromAnsi(ansi []string) (tcell.Color, error)
- func (t *Theme) CursorBackground() tcell.Color
- func (t *Theme) CursorForeground() tcell.Color
- func (t *Theme) DefaultBackground() tcell.Color
- func (t *Theme) DefaultForeground() tcell.Color
- type ThemeFactory
- 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 ¶
This section is empty.
Types ¶
type Annotation ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
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) Rune ¶
func (cell *Cell) Rune() MeasuredRune
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 BracketedPasteMode bool }
type MouseExtMode ¶
type MouseExtMode uint
type Option ¶
type Option func(t *Terminal)
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 Theme ¶
type Theme struct {
// contains filtered or unexported fields
}
func (*Theme) ColourFrom24Bit ¶
func (*Theme) ColourFrom4Bit ¶
func (*Theme) ColourFrom8Bit ¶
func (*Theme) ColourFromAnsi ¶
func (*Theme) CursorBackground ¶
func (t *Theme) CursorBackground() tcell.Color
func (*Theme) CursorForeground ¶
func (t *Theme) CursorForeground() tcell.Color
func (*Theme) DefaultBackground ¶
func (t *Theme) DefaultBackground() tcell.Color
func (*Theme) DefaultForeground ¶
func (t *Theme) DefaultForeground() tcell.Color
type ThemeFactory ¶
type ThemeFactory struct {
// contains filtered or unexported fields
}
func NewThemeFactory ¶
func NewThemeFactory() *ThemeFactory
func (*ThemeFactory) Build ¶
func (t *ThemeFactory) Build() *Theme
func (*ThemeFactory) WithColour ¶
func (t *ThemeFactory) WithColour(key Colour, colour tcell.Color) *ThemeFactory
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.