cursor.go

 1package tea
 2
 3// Position represents a position in the terminal.
 4type Position struct{ X, Y int }
 5
 6// CursorPositionMsg is a message that represents the terminal cursor position.
 7type CursorPositionMsg Position
 8
 9// CursorShape represents a terminal cursor shape.
10type CursorShape int
11
12// Cursor shapes.
13const (
14	CursorBlock CursorShape = iota
15	CursorUnderline
16	CursorBar
17)
18
19// requestCursorPosMsg is a message that requests the cursor position.
20type requestCursorPosMsg struct{}
21
22// RequestCursorPosition is a command that requests the cursor position.
23// The cursor position will be sent as a [CursorPositionMsg] message.
24func RequestCursorPosition() Msg {
25	return requestCursorPosMsg{}
26}