Show current open file and selected line info in cli #2046

Open
opened 2026-02-16 17:33:54 -05:00 by yindo · 14 comments
Owner

Originally created by @ravshansbox on GitHub (Oct 11, 2025).

Originally assigned to: @fwang on GitHub.

would also like:
include currently open file and selected lines as a context

Originally created by @ravshansbox on GitHub (Oct 11, 2025). Originally assigned to: @fwang on GitHub. would also like: include currently open file and selected lines as a context
Author
Owner

@github-actions[bot] commented on GitHub (Oct 11, 2025):

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

  • #3095: Automatically include currently open file and selected lines as a context

Both issues appear to be requesting similar functionality around displaying/including current open file and line information in the CLI context.

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

@github-actions[bot] commented on GitHub (Oct 11, 2025): This issue might be a duplicate of existing issues. Please check: - #3095: Automatically include currently open file and selected lines as a context Both issues appear to be requesting similar functionality around displaying/including current open file and line information in the CLI context. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 11, 2025):

currently open file where? I don’t think itd be easy for o do this unless you mean specifically for vscode integration (or a new ide integration)

@rekram1-node commented on GitHub (Oct 11, 2025): currently open file where? I don’t think itd be easy for o do this unless you mean specifically for vscode integration (or a new ide integration)
Author
Owner

@rekram1-node commented on GitHub (Oct 11, 2025):

is this for the vscode integration?

@rekram1-node commented on GitHub (Oct 11, 2025): is this for the vscode integration?
Author
Owner

@ravshansbox commented on GitHub (Oct 11, 2025):

@rekram1-node yes, the vscode extension, sorry for not being explicit

@ravshansbox commented on GitHub (Oct 11, 2025): @rekram1-node yes, the vscode extension, sorry for not being explicit
Author
Owner

@ravshansbox commented on GitHub (Oct 11, 2025):

That's the current behaviour of most agents like copilot, claude code, cline, kilo code (these are only the ones I have previously used)

@ravshansbox commented on GitHub (Oct 11, 2025): That's the current behaviour of most agents like copilot, claude code, cline, kilo code (these are only the ones I have previously used)
Author
Owner

@rekram1-node commented on GitHub (Oct 11, 2025):

oh okay perfect then this is doable

@rekram1-node commented on GitHub (Oct 11, 2025): oh okay perfect then this is doable
Author
Owner

@ravshansbox commented on GitHub (Oct 11, 2025):

Are we going to implement both:

  1. show info in cli
  2. auto include as context
@ravshansbox commented on GitHub (Oct 11, 2025): Are we going to implement both: 1) show info in cli 2) auto include as context
Author
Owner

@rekram1-node commented on GitHub (Oct 11, 2025):

Frank may have some opinions but showing info seems reasonable to me, we do support a few mechanisms to easily add files to context already so for that im not 100% sure what his preference would be but i could see utility in that too

@rekram1-node commented on GitHub (Oct 11, 2025): Frank may have some opinions but showing info seems reasonable to me, we do support a few mechanisms to easily add files to context already so for that im not 100% sure what his preference would be but i could see utility in that too
Author
Owner

@ravshansbox commented on GitHub (Oct 11, 2025):

At least maybe we can add it through explicit setting (opt-in)? It may make migration from other agents easier

@ravshansbox commented on GitHub (Oct 11, 2025): At least maybe we can add it through explicit setting (opt-in)? It may make migration from other agents easier
Author
Owner

@rekram1-node commented on GitHub (Oct 11, 2025):

yeah we do like making everything super customizable so that makes sense

i think adding current open file to context makes sense like cursor does it just needs to be obvious

@rekram1-node commented on GitHub (Oct 11, 2025): yeah we do like making everything super customizable so that makes sense i think adding current open file to context makes sense like cursor does it just needs to be obvious
Author
Owner

@taqtiqa-mark commented on GitHub (Oct 12, 2025):

  • auto include as context

The issue, #1990 is also relevant particularly if /add is implemented. This would allow other IDE's to "automagically" populate the context as they see fit (or at least, however they allow their users to)

@taqtiqa-mark commented on GitHub (Oct 12, 2025): > * auto include as context The issue, #1990 is also relevant particularly if `/add` is implemented. This would allow other IDE's to "automagically" populate the context as they see fit (or at least, however they allow their users to)
Author
Owner

@benvinegar commented on GitHub (Nov 9, 2025):

include currently open file and selected lines as a context

This is a crucial feature that works with Claude Code that I really miss.

Without it, I find myself spending time manually typing out what file and lines I'm looking at as part of my prompts. Whereas with VS Code/Cursor + Claude Code, I'd just select some lines in the editor and be off to the races. cc @jayair

@benvinegar commented on GitHub (Nov 9, 2025): > include currently open file and selected lines as a context This is a crucial feature that works with Claude Code that I really miss. Without it, I find myself spending time manually typing out what file and lines I'm looking at as part of my prompts. Whereas with VS Code/Cursor + Claude Code, I'd just select some lines in the editor and be off to the races. cc @jayair
Author
Owner

@aiyolo commented on GitHub (Dec 29, 2025):

any progress?

@aiyolo commented on GitHub (Dec 29, 2025): any progress?
Author
Owner

@altendky commented on GitHub (Jan 7, 2026):

i've been working around adjacent to this and have a couple times noticed what i think is this request working.

https://github.com/anomalyco/opencode/blob/2e4fe973c966af45ea67c1d9ff8fd3b6251e960f/sdks/vscode/src/extension.ts#L88

i think the timeout waiting for opencode to startup might be a bit short and getting in the way of this executing properly. the timeout is 2s.

anyways:

  1. i would be happy to double check my theory here and fix the existing behavior that's having trouble
  2. i am working on autodetection of the vscode-mcp-server plugin and registering it automatically in the opencode sessions launched by the opencode extension
@altendky commented on GitHub (Jan 7, 2026): i've been working around adjacent to this and have a couple times noticed what i think is this request working. https://github.com/anomalyco/opencode/blob/2e4fe973c966af45ea67c1d9ff8fd3b6251e960f/sdks/vscode/src/extension.ts#L88 i think the timeout waiting for opencode to startup might be a bit short and getting in the way of this executing properly. the timeout is 2s. anyways: 1. i would be happy to double check my theory here and fix the existing behavior that's having trouble 2. i am working on autodetection of the vscode-mcp-server plugin and registering it automatically in the opencode sessions launched by the opencode extension
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2046