package main import ( "os" "os/exec" tea "charm.land/bubbletea/v2" ) type editorFinishedMsg struct { err error } func openEditor(path string) tea.Cmd { editor := os.Getenv("EDITOR") if editor == "" { editor = "vim" } return tea.ExecProcess(exec.Command(editor, path), func(err error) tea.Msg { return editorFinishedMsg{err: err} }) }