diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-10 19:36:16 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-10 19:36:16 +0200 |
| commit | d1aeb4afa9afee8a0cce8827b4c2dd9f8c01fe5b (patch) | |
| tree | dbe81fe676541b20741b699cbcfbc7acbd750b15 /internal/tui/eventstream/export.go | |
| parent | c43932b6eee8b8a964b9be7c21c42057f05456ba (diff) | |
Prefer EDITOR for stream export opener
Diffstat (limited to 'internal/tui/eventstream/export.go')
| -rw-r--r-- | internal/tui/eventstream/export.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/internal/tui/eventstream/export.go b/internal/tui/eventstream/export.go index b9ddddc..f9534ff 100644 --- a/internal/tui/eventstream/export.go +++ b/internal/tui/eventstream/export.go @@ -138,7 +138,7 @@ func EditorCommandForPath(path string) (*exec.Cmd, error) { } func resolveEditorCommand() ([]string, string, error) { - candidates := []string{"SUDO_EDITOR", "VISUAL", "EDITOR"} + candidates := []string{"EDITOR", "VISUAL", "SUDO_EDITOR"} for _, key := range candidates { value := strings.TrimSpace(os.Getenv(key)) if value == "" { @@ -150,5 +150,12 @@ func resolveEditorCommand() ([]string, string, error) { } return parts, key, nil } - return []string{"vi"}, "fallback", nil + return []string{fallbackEditor()}, "fallback", nil +} + +func fallbackEditor() string { + if _, err := exec.LookPath("hx"); err == nil { + return "hx" + } + return "vi" } |
