{"record":{"id":"bf2aff650bd3b1f2","repo":"abiosoft/colima","slug":"no-editor-found-in-path-kindly-set-editor-envir","errorCode":null,"errorMessage":"no editor found in $PATH, kindly set $EDITOR environment variable and try again","messagePattern":"no editor found in \\$PATH, kindly set \\$EDITOR environment variable and try again","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/util.go","lineNumber":92,"sourceCode":"\t\t\teditor = e\n\t\t}\n\t}\n\n\t// if not found, check the preferred editors\n\tif editor == \"\" {\n\t\tfor _, e := range editors {\n\t\t\ts := strings.Fields(e)\n\t\t\tif _, err := exec.LookPath(s[0]); err == nil {\n\t\t\t\teditor = e\n\t\t\t\tlog.Println(\"editing in\", e)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// if still not found, abort\n\tif editor == \"\" {\n\t\treturn fmt.Errorf(\"no editor found in $PATH, kindly set $EDITOR environment variable and try again\")\n\t}\n\n\t// some editors need the wait flag, let us add it if the user has not.\n\tswitch editor {\n\tcase \"code\", \"code-insiders\", \"code-oss\", \"codium\", \"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code\":\n\t\teditor = strconv.Quote(editor) + \" --wait --new-window\"\n\tcase \"mate\", \"/Applications/TextMate 2.app/Contents/MacOS/mate\", \"/Applications/TextMate 2.app/Contents/MacOS/TextMate\":\n\t\teditor = strconv.Quote(editor) + \" --wait\"\n\t}\n\n\treturn cli.CommandInteractive(\"sh\", \"-c\", editor+\" \"+file).Run()\n}\n","sourceCodeStart":74,"sourceCodeEnd":105,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/cmd/util.go#L74-L105","documentation":"Thrown by launchEditor in cmd/util.go when no text editor can be resolved. The resolution order is: an editor passed explicitly by the calling command, then VSCode detection via TERM_PROGRAM=vscode, then the $EDITOR environment variable, then a hardcoded preference list (vim, 'code --wait --new-window', nano) probed with exec.LookPath. If every step fails, the interactive edit flow aborts with this error.","triggerScenarios":"Running a command that opens config for editing (e.g. 'colima start --edit') on a host where $EDITOR is unset/empty and exec.LookPath fails for every entry of the editors slice (vim, code, nano). On a VSCode terminal the TERM_PROGRAM check sets 'code --wait' without verifying it is in PATH, so the fallback list is still skipped only when the variable is set.","commonSituations":"Minimal Docker containers or CI runners with no editors installed; VSCode installed as a GUI app but the 'code' shell command never installed; SSH sessions where $EDITOR was never exported; wrapper scripts that scrub the environment before invoking colima.","solutions":["Export EDITOR to a terminal editor that exists, e.g. export EDITOR=nano, and retry the command","Install one of the probed editors: apt-get install -y vim (or nano), or brew install nano","For VSCode run 'Shell Command: Install code command in PATH' from the command palette so exec.LookPath finds 'code'","In CI or scripts, ensure the EDITOR variable is passed through instead of stripped from the environment"],"exampleFix":"# before\nunset EDITOR\ncolima start --edit   # error: no editor found in $PATH\n\n# after\nexport EDITOR=vim\ncolima start --edit","handlingStrategy":"validation","validationCode":"// resolveEditor reports whether launchEditor will find an editor.\nfunc resolveEditor() bool {\n    if os.Getenv(\"TERM_PROGRAM\") == \"vscode\" {\n        return true\n    }\n    if e := os.Getenv(\"EDITOR\"); e != \"\" {\n        return true\n    }\n    for _, e := range []string{\"vim\", \"code\", \"nano\"} {\n        if _, err := exec.LookPath(e); err == nil {\n            return true\n        }\n    }\n    return false\n}","typeGuard":null,"tryCatchPattern":"err := launchEditor(editor, file)\nif err != nil {\n    if strings.Contains(err.Error(), \"no editor found in $PATH\") {\n        // hint the user rather than failing silently\n        log.Println(\"set $EDITOR (e.g. export EDITOR=nano) and retry\")\n    }\n    return err\n}","preventionTips":["Always export EDITOR in dotfiles, CI images, and service units that invoke edit flows","Install at least one of vim, code, or nano on hosts that run interactive colima commands","Do not scrub the environment in wrapper scripts; TERM_PROGRAM and EDITOR are needed"],"tags":["editor","environment","cli","interactive"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}