Просмотр исходного кода

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

Co-authored-by: Aiden Cline <[email protected]>
William Tan 3 месяцев назад
Родитель
Сommit
4393cf8dbe
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      packages/opencode/src/cli/cmd/tui/util/editor.ts

+ 1 - 1
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`)