How Pandoc and Ranger Froze My Laptop
ranger to manage files from my shell, because it gives me vim-style navigation1 and search features that help me navigate my file system very quickly.
I use LibreOffice for all my spreadsheet needs because, well, Numbers.app is not available on Linux.
pandoc for a variety of reasons, including converting blog posts into PDFs.
When we put those three together, however, my laptop fan started blowing at top speed and wouldn’t stop. My laptop froze—or at least went very very slowly—and I had to reboot a few times and explore a little in order to discover the problem.
rangercan create previews of files as you navigate through the file system.
pandocto create previews of certain kinds of files, rendering the text from some kinds of non-text files. This makes it possible to preview a PDF, for example, by extracting the text instead of rendering a 1/4-size image of the file that only very young eyes could possibly read.
pandoc(at least version 2.18, which I have installed) becomes stuck when it tries to process an Open Document Spreadsheet (
*.ods). According to the project’s lead maintainer,
pandocdoesn’t support that format so whatever happens, happens.
- When I navigate to a directory in
rangerand that directory contains Open Document Spreadsheet files…
pandoctries very hard to render the spreadsheet, leaks memory, spins forever at top speed, and begins eating CPUs.
pandoc should not expect this problem to be resolved any time soon. Garbage in, garbage out, it seems. And yes: a binary file is garbage to a Markdown parser.
Install a version of
ranger that doesn’t try to render previews for Open Document Spreadsheet files. Sadly,
ranger doesn’t release new versions very often, which makes this slightly more complicated than installing the latest version from your Linux distribution’s package manager.
It appears that
ranger fixed the problem in commit 9da2b4c79323a3f34da8d54198364d549a29ff00. I built
ranger from source with the latest version of the main branch of the project as of 2023-04-20. This version worked for me. Building from source didn’t seem intimidating to me and it just worked the first time.
I hope you have a similarly smooth experience fixing the problem.
I would prefer kakoune-style navigation, but I can settle for vim.↩︎