pi-multiline
Adaptive multiline editor extension for Pi
Package details
Install pi-multiline from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-multiline- Package
pi-multiline- Version
0.1.0- Published
- Aug 1, 2026
- Downloads
- 153/mo · 33/wk
- Author
- jstavers
- License
- MIT
- Types
- extension
- Size
- 6.4 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./adaptive-multiline-editor.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
PiMultiline
PiMultiline is a standalone adaptive multiline editor extension for Pi. It keeps the usual one-line prompt workflow while making multiline prompts easier to write.
Features
- Enter submits a one-line prompt and inserts a newline after the prompt becomes multiline.
- Shift+Enter starts a multiline prompt explicitly.
- Cmd+Enter submits a multiline prompt. Ctrl+Enter is the equivalent fallback.
- Ctrl+U cuts the whole prompt, and Ctrl+Y restores it. This is useful when you need to clear a long prompt temporarily and then bring it back.
- The editor displays a
MULTILINE · ⌘↵ sendhint on multiline prompts.
Key bindings
| Key | Behavior |
|---|---|
| Enter | Submit a one-line prompt; insert a newline in a multiline prompt. Enter still selects autocomplete when autocomplete is active. |
| Shift+Enter | Start a multiline prompt by inserting a newline. |
| Cmd+Enter | Submit the current prompt, including multiline text. |
| Ctrl+Enter | Submit the current prompt, including multiline text. |
| Ctrl+U | Cut the whole prompt. |
| Ctrl+Y | Restore the prompt cut with Ctrl+U. |
Why whole-prompt cut?
Ctrl+U is useful when you have started writing a prompt but realize you need to do something else first—for example, change the model or get clarification before continuing. The prompt is removed from the editor but retained in Pi's kill ring. After handling the interruption, use Ctrl+Y to restore it.
The adaptive Enter behavior applies only when the current prompt already contains a newline. A one-line prompt still submits with Enter. While autocomplete is open, Enter keeps Pi's normal autocomplete behavior.
Install
After publication, install from npm:
pi install npm:pi-multiline
For a local checkout, run this from the directory containing PiMultiline:
pi install ./PiMultiline
Pi loads the extension from adaptive-multiline-editor.ts through the package manifest. The package declares Pi core imports as peer dependencies, so it does not bundle Pi.
Important behavior and limitations
- Ctrl+U overrides Pi's default delete-to-line-start behavior. In this extension it cuts the whole prompt instead.
- Ctrl+Y restores the whole-prompt cut through Pi's kill ring. The extension uses
killRing, which is a private/internal Pi editor API rather than a public API. - The extension calls
setEditorComponentduringsession_start. It can conflict with other custom editor extensions that also replace Pi's editor component. Use only one such editor replacement at a time.
Scope and security
This extension changes the interactive TUI editor only. It does not add tools, commands, network access, file access, or model behavior. Pi extensions execute with the permissions of the Pi process. Review extension source before installing it, especially when installing packages from sources you do not control.
Compatibility
Testing note: the package and source checks in this repository were run with Pi 0.83.0. Full key-by-key behavior requires an interactive TUI session. PiMultiline targets Pi's current TypeScript extension APIs and may need updates if those APIs change, especially the private killRing field or setEditorComponent behavior.
License
MIT. See LICENSE.