Skip to content

The open source coding agent.

TypeScript

tweak: Prefer VISUAL environment variable over EDITOR per Unix convention (#4549)

William Tan4393cf8dbe41
diff --git a/packages/opencode/src/cli/cmd/tui/util/editor.ts b/packages/opencode/src/cli/cmd/tui/util/editor.ts
index 0aa69dcd8ed..f98e24b0695 100644
--- a/packages/opencode/src/cli/cmd/tui/util/editor.ts
+++ b/packages/opencode/src/cli/cmd/tui/util/editor.ts
@@ -6,7 +6,7 @@ import { CliRenderer } from "@opentui/core"
export namespace Editor {
export async function open(opts: { value: string; renderer: CliRenderer }): Promise<string | undefined> {
- const editor = process.env["EDITOR"]
+ const editor = process.env["VISUAL"] || process.env["EDITOR"]
if (!editor) return
const filepath = join(tmpdir(), `${Date.now()}.md`)