# @kmiyh/pi-full-text-paste

`@kmiyh/pi-full-text-paste` is a Pi extension that keeps pasted text as full editor text.

By default, Pi may collapse large pastes into markers like `[paste #1 +123 lines]`. This extension disables that behavior and keeps the full pasted content directly in the input editor.

## What it does

- inserts large pasted text as full text
- prevents `[paste #...]` placeholders for big text pastes
- works with normal terminal paste / bracketed paste
- handles common paste shortcuts
- preserves Pi image paste: if the clipboard contains an image, the image paste wins

## Installation

```bash
pi install npm:@kmiyh/pi-full-text-paste
```

## Keyboard shortcuts

| System  | Use                                         |
|---------|---------------------------------------------|
| macOS   | `⌘V` or `Ctrl+V`                            |
| Windows | `Ctrl+V`, `Ctrl+Shift+V`, or `Alt+V`        |
| Linux   | `Ctrl+V`, `Ctrl+Shift+V`, or `Shift+Insert` |

Notes:
- On macOS, `⌘V` usually reaches Pi as a normal terminal paste event, not as a raw keybinding.
- The extension also recognizes raw shortcuts Pi receives: `Ctrl+V`, `Alt+V`, `Ctrl+Shift+V`, `Shift+Insert`.

## How it works

The extension replaces Pi's default editor with a custom editor and changes paste handling in two places:

1. **Terminal paste**: when the terminal sends pasted text, the extension inserts the full text instead of collapsing it.
2. **Clipboard shortcut paste**: when Pi receives a supported paste shortcut, the extension checks the clipboard.

Priority is:
- **image in clipboard** → use Pi's normal image paste
- **text in clipboard** → insert full text

## Limitations

- affects only the interactive TUI editor
- true low-level `Command+V` interception is not generally possible inside terminal apps on macOS
- if a terminal does not support normal paste events and does not pass through a supported paste shortcut, behavior may depend on that terminal
- if the clipboard contains both image and text, image is preferred for raw shortcut paste

## Local development

```bash
npm install
npm run typecheck
pi -e ./src/index.ts
```

## License

MIT
