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
Merge pull request #1118 from charmbracelet/v2-expAyman Bagabasbefore adoptiond1c8c97
lines 1–25why, one step back1package 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.fix: skip capability queries when input is disabled (#1801)draw me an elephantbefore adoption8b10e22
line 26why, one step back26// Use [WithInput] to enable input, since the reply cannot be read otherwise.Merge pull request #1118 from charmbracelet/v2-expAyman Bagabasbefore adoptiond1c8c97
lines 27–29why, one step back27func RequestCursorPosition() Msg {28 return requestCursorPosMsg{}29}