Yazi is a terminal-based file manager (TUI) that I use heavily because it’s fast and lets me navigate files and folders without needing a mouse. (…and I really dislike the OSX Finder)
Yazi can render previews for images and PDF files, but in my case, PDF previews weren’t showing up. Yazi requires Poppler for PDF previewing–and it was already installed on my system–the previews still didn’t work.
So I began debugging by running yazi --debug
, which provides detailed information about your Yazi installation. Under the Dependencies section, I noticed a suspicious message:
pdftoppm : ExitStatus(unix_wait_status(25344)),"pdftoppm version 4.0...
This should actually just render the version of pdftoppm by poppler like:
pdftoppm : 25.04.0
So there was clearly some issue with Poppler and pdftoppm here.
Then I ran Yazi with a debug log enabled: YAZI_LOG=debug yazi
and checked the log file in ~/.local/state/yazi/yazi.log
And there was also an error:
ERROR yazi_scheduler::prework::prework: Error when running preloader pdf:
Failed to convert PDF to image, stderr: pdftoppm version 4.05 [www.xpdfreader.com]
It turns out that Xpdf was conflicting with the actual pdftoppm
utility from Poppler. I had previously installed Xpdf for some reason, and it was now preventing Poppler from being installed properly. The error message confirmed the conflict:
Error: Cannot install poppler because conflicting formulae are installed.
xpdf: because poppler, pdftohtml, pdf2image, and xpdf install conflicting executables
So I uninstalled Xpdf via brew: brew unlink xpdf
Reinstalled Poppler via brew and now everything works nice:
