Documentation
¶
Overview ¶
Package vt provides a virtual terminal that implements tuist.Terminal backed by midterm.Terminal. It interprets all ANSI escape sequences exactly as a real terminal would — cursor movement, colors, line clearing, synchronized output, etc. — making it ideal for testing, headless rendering, and golden file snapshots.
Index ¶
- type Terminal
- func (m *Terminal) Columns() int
- func (m *Terminal) HideCursor()
- func (m *Terminal) Render() string
- func (m *Terminal) Rows() int
- func (m *Terminal) SetInputPassthrough(io.Writer)
- func (m *Terminal) ShowCursor()
- func (m *Terminal) Start(onInput func([]byte), onResize func()) error
- func (m *Terminal) Stop()
- func (m *Terminal) Write(p []byte)
- func (m *Terminal) WriteString(s string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Terminal ¶
type Terminal struct {
// VT is the underlying virtual terminal. Access it directly to
// inspect content, cursor position, cell formatting, etc.
VT *midterm.Terminal
}
Terminal implements tuist.Terminal backed by a midterm.Terminal. All output from the TUI is interpreted by the virtual terminal, producing a pixel-perfect representation of what a real terminal would display.
func (*Terminal) HideCursor ¶
func (m *Terminal) HideCursor()
func (*Terminal) Render ¶
Render returns the virtual terminal's content as a string including ANSI escape sequences for colors and formatting, capturing the full styled appearance as a real terminal would display it.
func (*Terminal) SetInputPassthrough ¶
func (*Terminal) ShowCursor ¶
func (m *Terminal) ShowCursor()