Skip to content

[FEATURE]: Integrated Manual File Editing via VS Code native diff editor #9370

Closed as not planned

Description

@iamseb4s

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Note: This builds upon and resolves the needs mentioned in #2167 and expands the discussion in #8003 by providing a full edit-and-sync implementation.

Problem

Currently, OpenCode handles file diffs exclusively within the TUI. While this is efficient for quick approvals, it lacks the flexibility for granular manual adjustments before committing a change. Users often need to make small corrections to the AI's output, a workflow that is currently cumbersome as it requires accepting the change first and then editing the file manually in a separate step.

Proposed Solution

I propose an integration that leverages the VS Code native diff editor when OpenCode is running in an integrated terminal. This provides a seamless "edit-and-approve" loop.
Key features of the implementation:

  • Automatic Environment Detection: Recognition of VS Code via TERM_PROGRAM to toggle between TUI and IDE modes without manual configuration.
  • Interactive Native Editing: 'edit' permission requests open a native VS Code diff tab, allowing users to modify the proposed changes directly in the IDE buffer.
  • Stateful Synchronization: Real-time IDE connection tracking via SSE with robust reconnection logic to ensure the CLI and IDE stay in sync across terminal restarts.
  • TUI Feedback: A minimalist UI state in the terminal (connection indicator + animated status) to provide clear feedback when the editor has focus.
  • Reliability: Integrated line-ending normalization to ensure consistent file writes from external IDE buffers.

Verification Performed

  • Validated with a full production build using Bun 1.3.5 (standalone binary test).
  • Verified SSE stability through server restarts and IDE reconnections.
  • Full type-safety check passed with turbo typecheck.

I have a functional prototype ready. I would like to open a PR for design review to ensure this aligns with the project's roadmap.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Jan 19, 2026
  2. github-actions commented on Jan 19, 2026

    @github-actions
    Contributor

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

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

  3. HoangP8 commented on Jan 30, 2026

    @HoangP8

    You may take a look at this: https://github.com/HoangP8/opencode-plugin-editor-diff
    View changed files directly in your editor — from the TUI. Try it out!

  4. bibendi commented on Mar 7, 2026

    @bibendi

    This is a highly useful feature that allows you to avoid vibe coding and instead use the agentic engineering approach.
    That's the only thing stopping me from migrating from Cline/Kilocode.

  5. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    webRelates to opencode on web / desktop
    on May 3, 2026
  6. github-actions commented on Jul 6, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions