Skip to content

feat: support sending to pi running in Neovim terminal#5

Merged
carderne merged 1 commit into
carderne:mainfrom
diidiiman:feat-nvim-terminal-fallback
Jun 15, 2026
Merged

feat: support sending to pi running in Neovim terminal#5
carderne merged 1 commit into
carderne:mainfrom
diidiiman:feat-nvim-terminal-fallback

Conversation

@diidiiman

Copy link
Copy Markdown
Contributor

When pi is started inside a Neovim terminal (:term pi), the unix socket sometimes fails to be correctly discovered or connected to, resulting in ENOENT errors when attempting to send prompts, files, or selections.

This PR adds a fallback mechanism inside M.prompt. Before attempting to connect via the socket, it scans the active Neovim buffers to see if there is a terminal buffer running pi. If one is found:

  1. It focuses the terminal (or opens it in a split if it is currently hidden).
  2. It sends the message payload using bracketed paste (\x1b[200~ ... \x1b[201~) to correctly handle multiline selections.
  3. It appends \r to submit the prompt directly.

This matches the behavior of similar plugins (like gemini-cli.nvim) and allows a seamless experience when users prefer to keep pi docked inside Neovim.

@carderne

Copy link
Copy Markdown
Owner

Thanks for this @diidiiman sorry for the really slow response but merging now!

@carderne carderne merged commit 00f8ec8 into carderne:main Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants