Setup ‘finder’ plugin for nnn Terminal File Manager on MacOS

Setup ‘finder’ plugin for nnn Terminal File Manager on MacOS

The finder plugin integrates the find command with nnn Terminal File Manager but out-of-the-box it doesn’t work on MacOS, throwing a bunch of errors.

Upgrade Bash

The first problem is the mapfile command not found on MacOS. This is because of an older version of bash installed on MacOS by default. Typically, bash version 3 is installed and mapfile is found on version 4 and higher.

Upgrade bash using brew package manager.

brew install bash

Default find path

The next error that shows up is find: illegal option --m. The cause of this error is find expects the first parameter to be the path where it should start looking. In gnu find, it is defaulted to . but in MacOS which uses bsd find, it is not defaulted.

The fix is to add . to the find command in the finder plugin so that it works across all platforms.

Here is the finder plugin file with the fix applied.

Update: The fix for find default path is now part of official repo.

One Reply to “Setup ‘finder’ plugin for nnn Terminal File Manager on MacOS”

Leave a Reply

Your email address will not be published. Required fields are marked *