[PR #10482] fix(tui): auto-scroll textarea cursor when typing long prompts #13459

Open
opened 2026-02-16 18:18:19 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/10482

State: open
Merged: No


What does this PR do?

Fixes the textarea cursor not auto-scrolling when typing long prompts that exceed the visible area (maxHeight of 6 lines).

When typing beyond the visible area, the cursor would move but the viewport wouldn't follow, leaving the text invisible and causing black/empty spaces to appear.

How did you verify your code works?

The fix adds markDirty() and requestRender() calls to the onContentChange handler, matching the pattern already used in:

  • onPaste handler (lines 926-929)
  • TuiEvent.PromptAppend handler (lines 98-100)

This ensures the layout is recalculated and the viewport syncs with cursor position on every keystroke.


Fixes #10401

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/10482 **State:** open **Merged:** No --- ### What does this PR do? Fixes the textarea cursor not auto-scrolling when typing long prompts that exceed the visible area (maxHeight of 6 lines). When typing beyond the visible area, the cursor would move but the viewport wouldn't follow, leaving the text invisible and causing black/empty spaces to appear. ### How did you verify your code works? The fix adds `markDirty()` and `requestRender()` calls to the `onContentChange` handler, matching the pattern already used in: - `onPaste` handler (lines 926-929) - `TuiEvent.PromptAppend` handler (lines 98-100) This ensures the layout is recalculated and the viewport syncs with cursor position on every keystroke. --- Fixes #10401 🤖 Generated with Claude Code
yindo added the pull-request label 2026-02-16 18:18:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13459