From c825888147ec17cd5afc82b11fe2848ded5951cd Mon Sep 17 00:00:00 2001 From: nbsp Date: Sun, 5 Jan 2025 21:12:06 +0200 Subject: [PATCH] hide cursor --- app/menu.go | 2 ++ ui/ui.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/app/menu.go b/app/menu.go index f4db832..be184fc 100644 --- a/app/menu.go +++ b/app/menu.go @@ -77,6 +77,7 @@ func (menu *MainMenu) Event(state *ui.State, event vaxis.Event) (processed bool) } func showManpage(state *ui.State) { + state.HideCursor() vt := term.New() vt.TERM = os.Getenv("TERM") vt.Attach(state.PostEvent()) @@ -90,6 +91,7 @@ func showManpage(state *ui.State) { for ev := range state.Events() { switch ev.(type) { case term.EventClosed: + state.HideCursor() state.Window().Clear() return case vaxis.Redraw: diff --git a/ui/ui.go b/ui/ui.go index 9a42d88..ce01b66 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -76,6 +76,10 @@ func (state *State) Render() { state.vx.Render() } +func (state *State) HideCursor() { + state.vx.HideCursor() +} + func (state *State) Window() vaxis.Window { return state.vx.Window() }