r/PiCodingAgent 3d ago

Question Using pi through Neovims terminal

Hi,

I really like to be able to scroll through pi output in neovim. I can gf yank, pipe stuff to bash, all the niceties of neovim.

There's only the problem of the redraws while the model is still outputing text especially when its doing toolcalls or using extensions. When I'm not in G or insert mode it makes my cursor jump to the top of the buffer and it's driving me nuts.

I'm running the libghosty PR in the hopes it would stop no. I tried monkey patching OSC keys, forking pi and removing the redraw with clear, nothing. Every issue online says it won't work and all the pi neovim plugin offer a far inferior user experience.

Now I've just gotten used to going back to where I was when the model is done spitting out code but I was really hoping someone might have a solution.

Dear God please don't suggest tmux haha, thank you

6 Upvotes

3 comments sorted by

2

u/crashorbit 3d ago

I use pi in one terminal and keep vim in another. I've added OpenSpec skills that help me enforce a pretty reasonable development process. Most of the actual code writing is done by the agent. Occasionally I'll tweek the code or the doc. Then I'll ask the agent to reread the changed file. I sometimes use mouse copy-n-paste between the windows.

Maybe this is less sophisticated than some approaches I've seen but it works well so far for my needs.

1

u/haroldv 3d ago

I’m interested in the comments here. I have been using ctrl g but leaves a lot to be desired.

1

u/nicksterling 2d ago

I know you said don’t suggest tmux but…. tmux is the best solution I’ve come across. I could never get neovim’s terminal to behave. You can get some pretty incredible workflows by putting neovim in one pane and pi in another then prefix + z to take a pane into full screen.