opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Fix: TUI single-line paste cursor position

Open Octane0411 opened this issue 5 days ago • 2 comments

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.

Octane0411 avatar Jan 08 '26 03:01 Octane0411