Files
libmutton/src/backend/initUNIX.go
T

20 lines
417 B
Go

//go:build !windows
package backend
import (
"os"
)
const FallbackEditor = "vi" // vi is pre-installed on most UNIX systems
// textEditorFallback returns the value of the $EDITOR environment variable, or FallbackEditor if it is not set
func textEditorFallback() string {
// ensure textEditor is set
textEditor := os.Getenv("EDITOR")
if textEditor == "" {
textEditor = FallbackEditor
}
return textEditor
}