How do I get terminal TAB completion on flatpak apps?

I want io.mpv.Mpv to complete video or audio file names when I hit tab in Zsh shell. I don’t remember what I did on my previous Fedora install to make it work.

It looks like the flatpak package includes the necessary bits for zsh at /usr/share/zsh/site-functions/_flatpak. Bash completion is working for me with flatpak. Make sure you’ve spelled the command right - completion works with flatpak info but not flatpak ifno, etc.

I dont use zsh but I find it useful to add /var/lib/flatpak/exports/bin and ~/.local/share/flatpak/exports/bin to my $PATH.

Doing that lets me type org.bar.Baz instead of flatpak run org.bar.Baz.