@qcts33/pi-herdr-editor
v0.1.4
Published
Open a Herdr pane with an external editor to compose messages to a pi agent — a non-blocking analogue of Ctrl+G.
Maintainers
Readme
@qcts33/pi-herdr-editor
A pi package that opens a sibling Herdr pane hosting an external editor for composing a message to the agent — a non-blocking analogue of pi's built-in Ctrl+G, which keeps the agent's output visible while you write.
How it works
Invoking /herdr-editor (or alt+g):
- Splits the current Herdr pane and waits for the new shell to become ready.
- Runs a probe that prints a start marker through the same printer the sentinel uses, and waits for it with a bounded timeout: if it never arrives — a pane shell that cannot run the command — the cycle fails with an error notification quoting the pane instead of waiting forever.
- Runs
$VISUAL/$EDITORon a temp file seeded with the current input-box content, through the shell's own eval so a malformed editor command cannot suppress the sentinel. - Waits (indefinitely) for a unique sentinel printed after the editor exits.
- Places the edited text back into pi's input box — not submitted; press Enter to send, inheriting pi's normal busy/idle handling.
The pane is closed when the compose cycle ends. Content that trims to empty cancels, leaving the input box unchanged. Outside Herdr it degrades to pi's built-in external-editor dialog.
The compose pane's shell is detected from the pane's own process, so PowerShell (pwsh,
powershell) and POSIX shells (sh, bash, zsh, fish, …) work regardless of platform —
Herdr's terminal.default_shell decides. A pane running a shell the extension cannot print
through (nushell, cmd.exe, …) falls back to the fullscreen dialog instead of hanging.
Install
pi install npm:@qcts33/pi-herdr-editorRequires HERDR_ENV=1 (running inside Herdr) for the pane flow; otherwise the fullscreen fallback
is used.
License
MIT
