cursor.go
This file
Path
cursor.go
29 lines · 779 bytes · Go
Last changed by
fix: skip capability queries when input is disabled (#1801)draw me an elephantbefore adoption8b10e22
History of this fileTake it
1package tea23// Position represents a position in the terminal.4type Position struct{ X, Y int }56// CursorPositionMsg is a message that represents the terminal cursor position.7type CursorPositionMsg struct {8 X, Y int9}1011// CursorShape represents a terminal cursor shape.12type CursorShape int1314// Cursor shapes.15const (16 CursorBlock CursorShape = iota17 CursorUnderline18 CursorBar19)2021// requestCursorPosMsg is a message that requests the cursor position.22type requestCursorPosMsg struct{}2324// RequestCursorPosition is a command that requests the cursor position.25// The cursor position will be sent as a [CursorPositionMsg] message.26// Use [WithInput] to enable input, since the reply cannot be read otherwise.27func RequestCursorPosition() Msg {28 return requestCursorPosMsg{}29}