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.

vifm-m_l opens tmux new window but vfm-m_v does not

0 votes
asked Mar 28 in vifm by anonymous

Hi,

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?

Thanks
sitaram

1 Answer

0 votes
answered Mar 28 by xaizek

Hello,

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.

commented Mar 28 by sitaram

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!

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...