Skip to content
Myr

Add command for hiding the cursor

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent 6d70abd · Browse files · 1 file+17 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+17 added−2 removed

  • other:+17 added−2 removed

1 file+17 added−2 removed

modified:tea.go+17 added-2 removed
91 unmodified lines
92 Width int93 Height int94}9596// HideCursor is a special command for manually instructing Bubble Tea to hide97// the cursor. In some rare cases, certain operations will cause the terminal98// to show the cursor, which is normally hidden for the duration of a Bubble99// Tea program's lifetime. You most likely will not need to use this command.100func HideCursor() Msg {101 return hideCursorMsg{}102}103104// hideCursorMsg is an internal command used to hide the cursor. You can send105// this message with HideCursor.106type hideCursorMsg struct{}107108// NewProgram creates a new Program.109func NewProgram(model Model) *Program {110 return &Program{111 initialModel: model,
92 unmodified lines
204 close(done)205 return err206 case msg := <-msgs:207196 // Handle quit message197 if _, ok := msg.(quitMsg); ok {208 // Handle special messages209 switch msg.(type) {210 case quitMsg:211 p.renderer.stop()212 close(done)213 return nil214 case hideCursorMsg:215 hideCursor(p.output)216 }217218 // Process batch commands219 if batchedCmds, ok := msg.(batchMsg); ok {
76 unmodified lines