Skip to content

Commit 476539b

Browse files
committed
Improve cursor hiding: use BubbleTea HideCursor cmd alongside ANSI escape
Belt-and-suspenders approach: emit tea.HideCursor() from Init as a command, plus keep the ANSI \033[?25l escape in View output as fallback for terminals that don't respond to BubbleTea's internal cursor management.
1 parent 55aeaa1 commit 476539b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tui.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,16 @@ func (m *model) reclassify() {
169169
m.cols = computeColumns(m.items)
170170
}
171171

172+
func hideCursorCmd() tea.Msg {
173+
return tea.HideCursor()
174+
}
175+
172176
func (m model) Init() tea.Cmd {
177+
cmds := []tea.Cmd{hideCursorCmd}
173178
if m.loading {
174-
return fetchDataCmd(m.org, m.limit)
179+
cmds = append(cmds, fetchDataCmd(m.org, m.limit))
175180
}
176-
return nil
181+
return tea.Batch(cmds...)
177182
}
178183

179184
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

0 commit comments

Comments
 (0)