Better detect if fallback editor needs to be used

This commit is contained in:
2024-03-07 23:51:34 -05:00
parent 652ef48dd5
commit 431082f711
4 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -16,9 +16,9 @@ func TempInit(configFileMap map[string]string) {
// ensure textEditor is set
if configFileMap["textEditor"] == "" {
textEditor := os.Getenv("EDITOR")
if textEditor == "" {
textEditor = fallbackEditor
textEditor, editorEnvPresent := os.LookupEnv("EDITOR")
if !editorEnvPresent {
textEditor = FallbackEditor
}
configFileMap["textEditor"] = textEditor
}