Kaynağa Gözat

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

Co-authored-by: Aiden Cline <[email protected]>
William Tan 3 ay önce
ebeveyn
işleme
4393cf8dbe

+ 1 - 1
packages/opencode/src/cli/cmd/tui/util/editor.ts

@@ -6,7 +6,7 @@ import { CliRenderer } from "@opentui/core"
 
 
 export namespace Editor {
 export namespace Editor {
   export async function open(opts: { value: string; renderer: CliRenderer }): Promise<string | undefined> {
   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
     if (!editor) return
 
 
     const filepath = join(tmpdir(), `${Date.now()}.md`)
     const filepath = join(tmpdir(), `${Date.now()}.md`)