How to make Midnight Commander exit to its current directory

mc
Carl Whalley picture Carl Whalley · Aug 18, 2016 · Viewed 14.2k times · Source

I've been using, in equal amounts, Fedora and Ubuntu for well over a decade now, and there's one minor but irritating difference I noticed from their installs of midnight commander. When you change dirs inside it using Fedora, then exit, it has done the chdir for you but in Ubuntu it keeps it at the place you started. Googling threw up a solution for older Ubuntus here: http://ptspts.blogspot.co.uk/2010/01/how-to-make-midnight-commander-exit-to.html but trying that fails on 16. When I say fails, I mean the commands are accepted without complaint but it doesn't change mc's behaviour in Ubuntu.

Answer

soger picture soger · Mar 16, 2018

The other responses are fine, but I feel like they are unsatisfying, here is my solution, which I think is the simplest:

Put this line into your ~/.profile

alias mc='source /usr/lib/mc/mc-wrapper.sh'