docs: expand TASK-015 — $EDITOR dispatcher wrapper covers gum/huh 'open in editor' + crontab
2e99c048470702f46b7ac5c8d088afa3dffbb08c
humdrum <me@humdrum.me> · 2026-06-29 09:41
parent 2b871cf7
1 files changed
- → Set-glint-as-the-editor-for-prose-based-tool-invocations-git-jj.md +16 −7
@@ -1,9 +1,12 @@
---
id: TASK-015
-title: Set glint as the editor for prose-based tool invocations (git/jj)
+title: >-
+ Make glint the editor for prose-based editor calls ($EDITOR dispatcher +
+ per-tool)
status: "\U0001F7E6 Backlog"
assignee: []
created_date: '2026-06-29 16:36'
+updated_date: '2026-06-29 16:41'
labels:
- feature
- release-2
@@ -15,14 +18,19 @@
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
-Adoption feature. $EDITOR is one slot for everything, so a coder must keep neovim there for code — but the prose-oriented editor calls (git commit/rebase/merge/tag messages, jj describe) can point at glint per-tool while $EDITOR stays the code editor. There is no OS-level text-vs-code split; it must be wired per tool.
+Adoption feature. $EDITOR is one slot for everything, so a coder keeps their code editor there — but the prose-oriented editor calls (git commit/rebase/merge/tag messages, jj describe, AND gum/huh 'open in editor' prompts, crontab -e, etc.) should be able to reach glint without taking over $EDITOR for code. There is no OS-level text-vs-code split; it must be done per-tool or via a dispatcher.
+
+Two complementary approaches, ideally both offered by a glint setup step (glint -c or a command), idempotent + reversible, documented in the README:
+
+1) Per-tool config (precise, no extension guessing):
+ - git: 'git config --global core.editor glint'
+ - jj: 'jj config set --user ui.editor glint'
+ These leave $EDITOR alone.
-Provide a convenience in the config walkthrough (glint -c) or a small command that idempotently sets:
- - git: 'git config --global core.editor glint' (commit/rebase/merge/tag messages, git config -e)
- - jj: 'jj config set --user ui.editor glint'
-…and leaves $EDITOR / $VISUAL alone. Offer to undo. Document the manual one-liners in the README.
+2) $EDITOR dispatcher wrapper (general — covers ANY tool that calls $EDITOR, including gum/huh Text fields, crontab -e):
+ A small script set as $EDITOR that routes by the temp file's extension/name — prose (*.md, *.markdown, *.txt, *COMMIT_EDITMSG*, generic temp) -> glint; everything else -> the user's code editor (nvim/etc.). glint ships/generates the script and points $EDITOR at it. Caveat: extension-based, so tools using an unhinted generic temp name hit the fallback; huh apps can set EditorExtension('.md') but the end user doesn't control that.
-One-shot editor mode already works: a tool calls 'glint <tmpfile>', the user edits, Ctrl+S saves, Ctrl+Q exits, the tool reads the saved file. Verify glint behaves cleanly when invoked on a non-.md tmpfile (e.g. COMMIT_EDITMSG) — it should still open/edit/save fine. Consider a save-on-quit prompt so an unsaved commit message isn't silently empty (the dirty-quit confirm largely covers this). Positioning: glint is the terminal WRITING app, owning prose edits, not the universal default editor.
+One-shot editor mode already works: a tool calls 'glint <tmpfile>', user edits, Ctrl+S saves, Ctrl+Q exits, the tool reads the saved file. Verify glint opens/edits/saves cleanly on non-.md tmpfiles (git COMMIT_EDITMSG); consider a save-on-quit safety so an unsaved message isn't silently empty. Positioning: glint is the terminal WRITING app owning prose edits, not the universal default editor.
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
@@ -31,4 +39,5 @@ - [ ] #1 A glint command / config step sets git core.editor (and jj ui.editor) to glint, leaving $EDITOR untouched
- [ ] #2 It is idempotent and offers an undo/unset
- [ ] #3 glint opens, edits, and saves cleanly when invoked one-shot on a non-.md tmpfile (e.g. git COMMIT_EDITMSG)
- [ ] #4 README documents the manual git/jj one-liners
+- [ ] #5 glint setup can install a $EDITOR dispatcher wrapper that routes prose temp files to glint and code to the user's editor (covers gum/huh, crontab, git)
<!-- AC:END -->