Skip to content
Myr

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 file

Take it

Merge pull request #1118 from charmbracelet/v2-expAyman Bagabasbefore adoptiond1c8c97

lines 1–25why, one step back
1package tea
23// 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 back
26// 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 back
27func RequestCursorPosition() Msg {
28 return requestCursorPosMsg{}29}