okami.mom/ultraviolet
git clone https://git.nkp.pet/okami.mom/ultraviolet
25e48a6
main
1package uv 2 3// CursorShape represents a terminal cursor shape. 4type CursorShape int 5 6// Cursor shapes. 7const ( 8CursorBlock CursorShape = iota 9CursorUnderline 10CursorBar 11) 12 13// Encode returns the encoded value for the cursor shape. 14func (s CursorShape )Encode (blink bool )int { 15// We're using the ANSI escape sequence values for cursor styles. 16// We need to map both [style] and [steady] to the correct value. 17s = (s * 2 )+ 1 //nolint:mnd 18if ! blink { 19s ++ 20 } 21return int (s ) 22}