[PR #7277] Fix: TUI single-line paste cursor position #12331

Closed
opened 2026-02-16 18:17:15 -05:00 by yindo · 0 comments
Owner

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

State: closed
Merged: Yes


Fix: TUI single-line paste cursor position

Description

This PR fixes a bug where pasting single-line text in the TUI prompt would incorrectly move the cursor to the end of the input buffer, instead of placing it immediately after the pasted text.

Issue

Fixes #7210

Changes

  • Removed input.gotoBufferEnd() from the onPaste handler in opencode/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx.

Verification

  • Verified that input.gotoBufferEnd() was the cause of the cursor jump.
  • The default behavior of the textarea component handles cursor positioning correctly for pasted text.
  • Retained markDirty() and requestRender() to ensure UI updates correctly after paste.
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7277 **State:** closed **Merged:** Yes --- # Fix: TUI single-line paste cursor position ## Description This PR fixes a bug where pasting single-line text in the TUI prompt would incorrectly move the cursor to the end of the input buffer, instead of placing it immediately after the pasted text. ## Issue Fixes #7210 ## Changes - Removed `input.gotoBufferEnd()` from the `onPaste` handler in `opencode/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx`. ## Verification - Verified that `input.gotoBufferEnd()` was the cause of the cursor jump. - The default behavior of the textarea component handles cursor positioning correctly for pasted text. - Retained `markDirty()` and `requestRender()` to ensure UI updates correctly after paste.
yindo added the pull-request label 2026-02-16 18:17:15 -05:00
yindo closed this issue 2026-02-16 18:17:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12331