@qcts33/pi-herdr-editor

Open a Herdr pane with an external editor to compose messages to a pi agent — a non-blocking analogue of Ctrl+G.

Packages

Package details

extension

Install @qcts33/pi-herdr-editor from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@qcts33/pi-herdr-editor
Package
@qcts33/pi-herdr-editor
Version
0.1.3
Published
Sep 15, 2026
Downloads
93/mo · 4/wk
Author
qcts33
License
MIT
Types
extension
Size
21.8 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

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):

  1. Splits the current Herdr pane and waits for the new shell to become ready.
  2. 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.
  3. Runs $VISUAL/$EDITOR on 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.
  4. Waits (indefinitely) for a unique sentinel printed after the editor exits.
  5. 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-editor

Requires HERDR_ENV=1 (running inside Herdr) for the pane flow; otherwise the fullscreen fallback is used.

License

MIT