Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by


Loving vifm; lots of cool stuff -- thank you!

Quick question. When I run :grep foo and get a result menu, hitting enter on any of those lines properly opens up the file in a new tmux window. But hitting v to open all of them in a vim quickfix list, uses the same window as vifm, instead of opening and using a new tmux window.

Is there a reason for this?


1 Answer

0 votes


Loving vifm; lots of cool stuff -- thank you!

Glad to hear that!

Is there a reason for this?

When a command is run in a separate window, it's detached, so vifm loses ability to send input to it, which is how it communicates with vim in this case.

It might be possible to overcome this by making a temporary file and adding input redirection, but vifm won't have the ability to delete the file, which means that temporary files will pile up. I think this is why it wasn't done before.


I just tried it, and indeed, it's a race. If you delete the file too quickly, the vim does not have a chance to pick up the quickfix list.

On my laptop, this worked:

# first, produce file "qflist", which currently goes to STDIN of vim
# then:
tmux new-window "vim +cgetbuffer +bd! +cfirst qflist"
sleep 1
rm qflist

But who knows how long you have to sleep on a loaded system. Anyway races aren't fun, so I agree this can't be done cleanly.

Thanks for your prompt response!