diff --git a/ui/open.go b/ui/open.go index d57d1a8..2f018a2 100644 --- a/ui/open.go +++ b/ui/open.go @@ -85,12 +85,6 @@ func OpenEditor(tv *TutView, content string) (string, error) { } else { editor = strings.TrimSpace(tv.tut.Config.General.Editor) } - args := []string{} - parts := strings.Split(editor, " ") - if len(parts) > 1 { - args = append(args, parts[1:]...) - editor = parts[0] - } f, err := os.CreateTemp("", "tut") if err != nil { return "", err @@ -102,9 +96,8 @@ func OpenEditor(tv *TutView, content string) (string, error) { } } fname := f.Name() - args = append(args, fname) f.Close() - cmd := exec.Command(editor, args...) + cmd := exec.Command("/bin/sh", "-c", editor + " " + f.Name()) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr