Skip to content

Cursor blink stops firing entirely on iTerm2 (huh.Input never re-renders while idle #799

Description

@cavesubmarine

Description

A huh.Input field's cursor is supposed to blink (default cursor.CursorBlink mode) once focused, re-rendering every BlinkSpeed (~530ms). On iTerm2, it doesn't blink at all — not
just visually, but the underlying Bubble Tea program never re-renders during idle time. Captured raw terminal output confirms only a single frame is written for the entire idle period;
no BlinkMsg-triggered redraw ever happens.

To Reproduce

Minimal repro:

package main

import (
      "fmt"

      "charm.land/huh/v2"
)

func main() {
      var s string
      f := huh.NewForm(huh.NewGroup(huh.NewInput().Title("Wait a few seconds without typing").Value(&s)))
      if err := f.Run(); err != nil {
              fmt.Println("err:", err)
      }
      fmt.Println("value:", s)
}

Steps:
1. Build and run the program in iTerm2.
2. Do not press any key for 4-5 seconds.
3. Press Enter to submit and exit.
4. Capture raw output via script -q out.log ./binary while doing the above.

Expected behavior

Cursor should visibly blink (alternate reverse-video rendering) every ~530ms while the field is focused and idle, producing periodic redraw frames in the captured output.

Actual behavior

Only the initial frame is ever written. Diffing the captured session shows:
- One full render right after Init() (title, prompt, cursor block with \x1b[38;2;R;G;B;7mthe ;7 confirming the "visible" reverse-video state is drawn once).
- Zero additional frames for the entire idle window (verified over 4-5s, no \x1b[7m/reverse toggling repeats).
- Then the standard exit sequence (\x1b[?2026l, \x1b[?25h, \x1b[?2004l, \x1b[?1004l, ...) on submit.

This means the blink timer/command (cursor.Model.Blink() → BlinkMsg after BlinkSpeed) never re-enters the Bubble Tea event loopthis is a functional issue (missing redraw), not just a
terminal rendering/visibility quirk.

### Version

- charm.land/huh/v2: v2.0.3   - Tried both:     - charm.land/bubbletea/v2 v2.0.2 + charm.land/bubbles/v2 v2.0.0 (original pinned versions) — bug present     - charm.land/bubbletea/v2 v2.0.8 + charm.land/bubbles/v2 v2.1.1 (latest at time of testing) — bug still present

### Environment

- OS: macOS (Darwin 25.5.0, arm64)   - Go: go1.26.4 darwin/arm64   - Terminal: iTerm2 Build 3.6.4   - TERM=xterm-256color (also reproduced with TERM=xterm overrideno change)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions