Repository navigation
Description
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
Description
Related
Problem
The OpenCode TUI currently supports opening an external editor for composing messages via Ctrl+E or the /editor command. However, this is limited to message editing and uses a single editor defined by the EDITOR environment variable. There is no general way to open a project file from the TUI in an external editor.
In real workflows, developers often need to open project files while working inside the TUI. For example:
- Opening Markdown files in Typora for visual editing and preview.
- Opening code files in VS Code or Cursor for deeper changes.
- Opening configuration files in Notepad++ or another lightweight editor.
Today, users must leave the TUI, switch to an external editor, navigate to the file path, and open the file manually. This breaks the flow of working inside the terminal.
The current mechanism also has limitations:
EDITORcan only define one editor, so users cannot choose different editors for different file types.- The existing editor integration only applies to message composition, not project files.
- There is no context menu or shortcut for opening a file from the TUI in an external editor.
This is related to #30135, which asks to re-add the “Open in external editor” option from the old TUI and suggests making it a configurable editor list, such as “Open in VS Code” or “Open in Notepad++”.
Proposed enhancement
Add a general “Open in external editor” action to the TUI, with support for user-defined editors.
-
Action entry point: Add an “Open in external editor” option in the file list, session file changes,
@file picker, or file preview. It could be triggered from a right-click context menu or a keyboard shortcut such asCtrl+Shift+E. -
User-defined editor configuration: Allow users to configure multiple external editors in
opencode.jsonortui.json. Each editor should have a display name and a launch command. For example:{ "externalEditors": [ { "name": "Typora", "command": "typora" }, { "name": "VS Code", "command": "code" }, { "name": "Notepad++", "command": "notepad++" } ] }When multiple editors are configured, selecting “Open in external editor” should show a picker listing all configured editors.
-
Smart default behavior: If only one editor is configured, open the file directly with it. If no editor is configured, fall back to the editor defined by
EDITOR. -
Optional file type associations: Support mapping file extensions to default editors, such as
.mdto Typora and.tsto VS Code, similar to operating system file associations.
Why this matters
Developers working in terminal-based environments depend on the TUI for a continuous workflow. The value of the TUI is that users can chat with the model, browse files, and modify code in one interface. However, the lack of a direct way to open project files in an external editor forces users to switch windows repeatedly between the terminal and their editor.
Allowing users to customize external editors makes this workflow practical. Typora can handle Markdown documents, VS Code can handle source code, and Notepad++ can handle quick edits. This enhancement not only restores functionality that existed before the TUI rewrite, as referenced in #30135, but also makes it more flexible through user configuration.
Alternatives
- Continue using only
EDITORand manually changing it when a different editor is needed. - Leave the TUI and run shell commands to open files in external editors.
- Rely on OS-level file associations outside the TUI.
Activity
No response.
Activity
github-actions commentedon Sep 12, 2026
This issue might be a duplicate of existing issues. Please check:
externalEditorsconfig and file-type associations described here.If your request is distinct from all of these, please clarify how it differs so maintainers can evaluate it separately.
opencodejr commentedon Oct 28, 2026
Thanks for the detailed write-up, @wgm66!
To restate the request: you'd like an "Open in external editor" action for project files in the TUI (file picker, session file changes, file preview). It would use a configurable list of editors, show a picker when more than one is configured, optionally map file extensions to a default editor, and fall back to
$EDITORwhen nothing is configured. Maintainers will consider it.Related issues:
On plugins: the current TUI plugin API can add commands, keybinds and dialogs. So a plugin could offer something like a
/open <file>command with an editor picker. However, plugins currently can't add actions to file entries in the@file picker, the session file changes list or a file preview, and that's the core of what you're asking for. A plugin would only be a partial workaround for now. A plugin API hook for file-level actions would make this possible, and I've passed that suggestion to the maintainers.