Running mc (midnight commander) under su on Mojave/Catalina/Big Sur/Monterey

Solution 1:

It appears that mc requires to match precompiled shell version, e.g. /bin/bash to be the one.

In order to resolve this, its is required to change default root shell from sh to bash, and do it with following command:

sudo dscl . -change /Users/root UserShell /bin/sh /bin/bash

To revert back in case you have some problems, just reverse the parameters:

sudo dscl . -change /Users/root UserShell /bin/bash /bin/sh

Just in case above commands do not work, may be default shell was already changed. Check it with command:

dscl . -read /Users/root UserShell

Hope it will save tons of time for you.