diff --git a/screen.go b/screen.go index 2c7c771..e8df7b1 100644 --- a/screen.go +++ b/screen.go @@ -92,6 +92,16 @@ func HideCursor() Msg { // this message with HideCursor. type hideCursorMsg struct{} +// ShowCursor is a special command for manually instructing Bubble Tea to show +// the cursor. +func ShowCursor() Msg { + return showCursorMsg{} +} + +// showCursorMsg is an internal command used to show the cursor. You can send +// this message with ShowCursor. +type showCursorMsg struct{} + // EnterAltScreen enters the alternate screen buffer, which consumes the entire // terminal window. ExitAltScreen will return the terminal to its former state. // diff --git a/tea.go b/tea.go index df6c680..c561c2d 100644 --- a/tea.go +++ b/tea.go @@ -394,6 +394,9 @@ func (p *Program) StartReturningModel() (Model, error) { p.renderer.disableMouseCellMotion() p.renderer.disableMouseAllMotion() + case showCursorMsg: + p.renderer.showCursor() + case hideCursorMsg: p.renderer.hideCursor()