Documentation
¶
Index ¶
- Constants
- func SGRSequence(param ...Param) func(string) string
- type Param
- type ParamFunc
- type Writer
- func (w *Writer) ClearLine()
- func (w *Writer) ClearLineRight()
- func (w *Writer) ClearScreen()
- func (w *Writer) ClearScreenBelow()
- func (w *Writer) Close() error
- func (w *Writer) CursorHome()
- func (w *Writer) CursorPos(row, col int)
- func (w *Writer) DisableBlinkingCursor()
- func (w *Writer) EnableBlinkingCursor()
- func (w *Writer) HideCursor()
- func (w *Writer) MoveDown()
- func (w *Writer) MoveDownRows(rows int)
- func (w *Writer) MoveLeft()
- func (w *Writer) MoveLeftCols(cols int)
- func (w *Writer) MoveRight()
- func (w *Writer) MoveRightCols(cols int)
- func (w *Writer) MoveUp()
- func (w *Writer) MoveUpRows(rows int)
- func (w *Writer) Newline()
- func (w *Writer) ResetLine()
- func (w *Writer) RestoreCursor()
- func (w *Writer) SaveCursor()
- func (w *Writer) ShowCursor()
- func (w *Writer) Write(p []byte) (int, error)
Constants ¶
View Source
const (
Reset = csi + resetParam + sgrFinalByte
)
Control Sequence Introducer Parameters
Variables ¶
This section is empty.
Functions ¶
func SGRSequence ¶
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer wraps an io.Writer and optionally handles: - converting '\n' → '\n\x1b[G' - raw mode enabling/restoring
func NewErrWriter ¶
func NewOutWriter ¶
func NewWriter ¶
NewWriter wraps the given io.Writer. It enables newline reset and raw mode if writing to a TTY. Returns a WriteCloser for deferred cleanup.
func (*Writer) ClearLineRight ¶
func (w *Writer) ClearLineRight()
func (*Writer) ClearScreen ¶
func (w *Writer) ClearScreen()
func (*Writer) ClearScreenBelow ¶
func (w *Writer) ClearScreenBelow()
func (*Writer) CursorHome ¶
func (w *Writer) CursorHome()
func (*Writer) DisableBlinkingCursor ¶
func (w *Writer) DisableBlinkingCursor()
func (*Writer) EnableBlinkingCursor ¶
func (w *Writer) EnableBlinkingCursor()
Works reliably in xterm, iTerm2, and most Linux TTYs. Does not work in Windows Terminal or cmd.exe It’s safe to call even if unsupported; it’ll just be ignored.
func (*Writer) HideCursor ¶
func (w *Writer) HideCursor()
func (*Writer) MoveDownRows ¶
func (*Writer) MoveLeftCols ¶
func (*Writer) MoveRightCols ¶
func (*Writer) MoveUpRows ¶
func (*Writer) Newline ¶
func (w *Writer) Newline()
Newline prints a newline and moves the cursor to column 0.
func (*Writer) RestoreCursor ¶
func (w *Writer) RestoreCursor()
func (*Writer) SaveCursor ¶
func (w *Writer) SaveCursor()
func (*Writer) ShowCursor ¶
func (w *Writer) ShowCursor()
Click to show internal directories.
Click to hide internal directories.