opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Pasting file paths with line references (e.g. file.tsx:39-42) causes error and disables Enter button

Open itse4elhaam opened this issue 2 months ago • 5 comments

Description

When a file with line reference (@src/components/checkout/MultiStep.tsx:39-42) is pasted, an error is shown (please see the screenshot), and the enter button is disabled (does not work).

I know this is probably intentional, but in the earlier versions (pre 1.0), it used to pick up the file correctly regardless of he format.

The use case for this comes up with this is used in Neovim using SideKick.nvim

OpenCode version

1.0.20

Steps to reproduce

  1. Paste a file name with lines appended without any spaces as described in the docs
  2. (Optional) use the require("sidekick.cli").send { msg = "{this}" } with SideKick.nvim

Screenshot and/or share link

Image

Operating System

Pop!_OS 22.04 LTS

Terminal

Ghostty

itse4elhaam avatar Nov 04 '25 17:11 itse4elhaam

This issue might be a duplicate of existing issues. Please check:

  • #3624: 1.0.0 - pasting file path into terminal doesn't 'link' to proper file path - Similar issue with pasting file paths not working in v1.0.0
  • #3714: OpenTUI: Opening a chat with a file path breaks OpenCode - Similar issue where pasting file paths causes OpenCode to break

Both issues describe problems with file path handling in the OpenTUI version (v1.0+) that worked in previous versions.

Feel free to ignore if none of these address your specific case with line references.

github-actions[bot] avatar Nov 04 '25 17:11 github-actions[bot]

it's because the autocomplete opened and couldn't find any results - we currently don't dismiss autocomplete until you press "Escape" but maybe we should on space

thdxr avatar Nov 04 '25 19:11 thdxr

@thdxr I just made a fix for that (the space)

rekram1-node avatar Nov 04 '25 19:11 rekram1-node

@thdxr I just made a fix for that (the space)

Will the fix be available in the next release or can I install it (By building it from source, if that is an option?)

itse4elhaam avatar Nov 04 '25 19:11 itse4elhaam

@itse4elhaam can u try v1.0.22?

rekram1-node avatar Nov 04 '25 19:11 rekram1-node