mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
feat: add tea.ShowCursor, complementing tea.HideCursor
This commit is contained in:
10
screen.go
10
screen.go
@@ -92,6 +92,16 @@ func HideCursor() Msg {
|
|||||||
// this message with HideCursor.
|
// this message with HideCursor.
|
||||||
type hideCursorMsg struct{}
|
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
|
// EnterAltScreen enters the alternate screen buffer, which consumes the entire
|
||||||
// terminal window. ExitAltScreen will return the terminal to its former state.
|
// terminal window. ExitAltScreen will return the terminal to its former state.
|
||||||
//
|
//
|
||||||
|
|||||||
3
tea.go
3
tea.go
@@ -394,6 +394,9 @@ func (p *Program) StartReturningModel() (Model, error) {
|
|||||||
p.renderer.disableMouseCellMotion()
|
p.renderer.disableMouseCellMotion()
|
||||||
p.renderer.disableMouseAllMotion()
|
p.renderer.disableMouseAllMotion()
|
||||||
|
|
||||||
|
case showCursorMsg:
|
||||||
|
p.renderer.showCursor()
|
||||||
|
|
||||||
case hideCursorMsg:
|
case hideCursorMsg:
|
||||||
p.renderer.hideCursor()
|
p.renderer.hideCursor()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user