{"record":{"id":"380b50a8a19743a3","repo":"laurent22/joplin","slug":"no-text-editor-is-defined-please-set-it-using-co","errorCode":null,"errorMessage":"No text editor is defined. Please set it using `config editor <editor-path>`","messagePattern":"No text editor is defined\\. Please set it using `config editor <editor-path>`","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/app-cli/app/command-edit.ts","lineNumber":30,"sourceCode":"\tpublic override usage() {\n\t\treturn 'edit <note>';\n\t}\n\n\tpublic override description() {\n\t\treturn _('Edit note.');\n\t}\n\n\tpublic override async action(args: { note: string }) {\n\t\tlet tempFilePath: string|null = null;\n\n\t\tconst onFinishedEditing = async () => {\n\t\t\tif (tempFilePath) fs.removeSync(tempFilePath);\n\t\t};\n\n\t\tconst textEditorPath = () => {\n\t\t\tif (Setting.value('editor')) return Setting.value('editor');\n\t\t\tif (process.env.EDITOR) return process.env.EDITOR;\n\t\t\tthrow new Error(_('No text editor is defined. Please set it using `config editor <editor-path>`'));\n\t\t};\n\n\t\ttry {\n\t\t\t// -------------------------------------------------------------------------\n\t\t\t// Load note or create it if it doesn't exist\n\t\t\t// -------------------------------------------------------------------------\n\n\t\t\tconst title = args['note'];\n\n\t\t\tif (!app().currentFolder()) throw new Error(_('No active notebook.'));\n\t\t\tlet note = await app().loadItem(ModelType.Note, title);\n\n\t\t\tthis.encryptionCheck(note);\n\n\t\t\tif (!note) {\n\t\t\t\tconst ok = await this.prompt(_('Note does not exist: \"%s\". Create it?', title));\n\t\t\t\tif (!ok) return;\n\t\t\t\tnote = await Note.save({ title: title, parent_id: app().currentFolder().id });","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/laurent22/joplin/blob/2654b33620775080d1d59c552259d41e33dad3d2/packages/app-cli/app/command-edit.ts#L12-L48","documentation":"The 'edit' command needs an external text editor to open the note. It resolves the editor path by checking Setting.value('editor') first, then process.env.EDITOR; if both are unset it throws 'No text editor is defined'. The message is i18n-translated.","triggerScenarios":"Running 'edit <note>' (or creating a note via edit) when no editor is configured in Joplin settings and the EDITOR environment variable is not set.","commonSituations":"First use on a machine with no EDITOR in the environment; settings reset; a headless/container environment with no editor installed.","solutions":["Configure the editor in Joplin: 'config editor <editor-path>' (e.g. 'config editor vim').","Export EDITOR in your shell (e.g. 'export EDITOR=nano') and relaunch.","Ensure the configured binary is installed and on PATH.","Use an absolute path to the editor if it is not on PATH."],"exampleFix":"# before\n#   joplin edit \"my note\"   # throws: no editor\n# after\n#   joplin config editor /usr/bin/nano\n#   joplin edit \"my note\"","handlingStrategy":"validation","validationCode":"const editor = Setting.value('editor') || process.env.EDITOR;\nif (!editor) {\n  throw new Error('Set an editor first: `config editor <path>` or export EDITOR=<path>`');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run 'config editor <editor-path>' during initial setup.","Export EDITOR in your shell profile as a fallback.","Use an absolute path when the editor is not on PATH."],"tags":["cli","edit-command","editor","config","environment","i18n"],"backgroundTag":null,"analyzedSha":"2654b33620775080d1d59c552259d41e33dad3d2","analyzedAt":"2026-08-12T14:26:46.263Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}