GNU Readline-style reverse history search for pi. Press Ctrl+R in the editor to revisit prompts and bash commands from the current branch history without leaving the editor.
pi install ./pi install git:github.com/mrshu/pi-readline-search- Press Ctrl+R in the editor to open reverse search.
- Type to filter the branch-local history index.
- Press Ctrl+R or ↑ to move to older matches.
- Press Ctrl+S or ↓ to move to newer matches.
- Press Enter to insert the selected match, or Esc/Ctrl+G to cancel.
The index includes user prompts and bashExecution commands. Commands keep their pi prefixes as !command or !!command depending on context inclusion.
| Key | Action |
|---|---|
Ctrl+R |
Open search, then cycle older matches |
Ctrl+S |
Cycle newer matches |
↑ / ↓ |
Older / newer match navigation |
Enter |
Accept selected match into the editor |
Esc or Ctrl+G |
Cancel reverse search |
- If pi shows "No prompt history yet for reverse search.", there are no indexed prompts or
bashExecutionentries in this branch yet. - Fresh branches can show no results until you create some prompt or command history.
- If
Ctrl+Ris intercepted by another tool, test in a clean terminal session or rebind the shortcut in pi.
- Works with pi extension loading via
pi.extensions: ["./extensions"]and the entry fileextensions/readline-search.ts. - No extra OS-specific setup is required beyond a working pi environment.
pi -e ./extensions/readline-search.tsSee CHANGELOG.md for release history.
This repo is a pi package via package.json:
pi.extensions: ["./extensions"]- Extension entry:
extensions/readline-search.ts