Skip to content

TUI: input deaf and unbuffered for ~15-20s after first paint on a cold cache - reads as a total freeze to new users #1141

Closed

Description

@iamtoruk

Reproduced from our side while investigating #1139, on 0.9.21, macOS, Node 26.7, pty-driven:

  • Cold-cache interactive launch paints normally (fixture corpus: 0.7s via npx).
  • For roughly 15-20s after paint, keyboard input is unresponsive: a single q or Ctrl+C pressed in that window is swallowed and never acted on (raw mode, not buffered). Pressed after the window settles, q exits in under a second. Output flow measurement shows no repaint loop (11KB then silence) - the event loop is starved by the post-paint background index (perf: progressive cold start — paint the dated TUI first, index history in the background #1109 fill startup), not rendering.
  • Ctrl+C DURING the pre-paint parse phase works; only the post-paint window is deaf.

Why it matters: a first-run user with a large history sees minutes of indexing, then a paint, presses Ctrl+C in the deaf window, concludes the app froze, and kills the terminal - so the first index never completes and every retry is cold again (#1139 is exactly this shape: npx and brew both 'freeze', menubar 'Couldn't load today' from its fetch timing out against the never-finished index). This was logged as the cold-quit-latency WARN in the 0.9.21 release sweep; it is a bug, not a latency footnote.

Fix directions to evaluate: yield to the event loop during fill startup (the fill itself is already async per #1109 - the starvation is in its synchronous setup/cache write), and/or buffer keystrokes arriving during the deaf window so a q/Ctrl+C is honored the moment the loop breathes. An immediate Ctrl+C should abort cleanly at any phase.

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

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions