Introduction to MC

MC (Midnight Commander) is a text-mode full-screen file manager and visual shell. It provides a clear, user-friendly, and somewhat protected interface to a Unix system while making many frequent file operations more efficient and preserving the full power of the command prompt.

Package Information

Additional Downloads

Do I Need the Debian Patch?

Midnight Commander without the Debian patch is completely unusable in multibyte locales because it assumes that characters and bytes are the same thing. The issue manifests itself as massive screen content corruption similar to what is depicted in this screenshot (taken in the ru_RU.UTF-8 locale). For a general discussion of this type of issue, see the Breaks Multibyte Characters section of the Locale Related Issues page. The Debian patch mostly fixes this issue, and adds support for recoding remote FTP filenames. Debian also fixed 64-bit issues, rare segfaults in mcedit, and improved syntax highlighting.

If you do not use a multibyte locale and do not need any of the new features or fixes, the patch is still supposed to be harmless. However, the patch changes the dependencies and build instructions, and in the past it caused unacceptable regressions for non-UTF-8 locale users. Thus, failsafe instructions without the patch are left in the book just in case. Due to the size and unofficial nature of the patch, please do not report bugs in the patched MC to the original MC developers.

MC Dependencies


GLib-1.2.10 (untested with Debian patch) or GLib-2.12.12


GPM-1.20.1, X Window System, Samba-3.0.30, S-Lang-2.1.3 (required when building with Debian patch), Zip-2.32, UnZip-5.52, and GNOME Libraries-1.4

User Notes:

Installation of MC

Fix incompatibility of MC-4.6.1 with Bash-3.2:

patch -Np1 -i ../mc-4.6.1-bash32-1.patch

If desired, apply Debian fixes:

patch -Np1 -i ../mc-4.6.1-debian_fixes-1.patch

Install MC by running the following commands:

CPPFLAGS="-DUTF8" ./configure --prefix=/usr \
            --enable-charset &&

MC with Debian patches expects its documentation to be stored in UTF-8 encoding on disk, and automatically converts it to the locale encoding when displaying on the terminal. This is different from the expectations of the unpatched MC, so the documentation files have to be converted if (and only if) the Debian patch has been applied:

convert-mans ISO-8859-1 UTF-8 lib/mc.hint{,.es,.it,.nl} &&
convert-mans ISO-8859-2 UTF-8 lib/mc.hint{.cs,.hu,.pl} &&
convert-mans ISO-8859-5 UTF-8 lib/ &&
convert-mans KOI8-R UTF-8 lib/ &&
convert-mans KOI8-U UTF-8 lib/ &&
convert-mans BIG5 UTF-8 lib/mc.hint.zh &&
convert-mans ISO-8859-1 UTF-8 doc/{es,it}/mc.hlp.* &&
convert-mans ISO-8859-2 UTF-8 doc/{hu,pl}/mc.hlp.* &&
convert-mans ISO-8859-5 UTF-8 doc/sr/ &&
convert-mans KOI8-R UTF-8 doc/ru/

This package does not come with a test suite.

Now, as the root user:

make install &&
chmod 1755 /usr/lib/mc/cons.saver

Command Explanations

CPPFLAGS="-DUTF8": This parameter activates UTF-8 support in the Debian patch and has no effect without this patch.

--enable-charset: This option adds support to mcedit for editing files in encodings different from the one implied by the current locale. This feature works in non-UTF-8 locales only, even with the Debian patch.

--with-screen=(slang|mcslang|ncurses): This parameter selects the screen library used by MC. NCurses support is currently buggy (MC does not handle mouse events in xterm correctly). UTF-8 support in the Debian patch is functional only when external S-Lang-2.1.3 is used as a screen library (this is the default).

--with-codepagedir=DIR: This parameter was useful only with SAMBA-2.x. New versions of SAMBA do not have codepage files.

chmod 1755 /usr/lib/mc/cons.saver: The cons.saver program has to be installed setuid root, because on LFS regular users have no access to /dev/vcsa* devices. This step is optional if MC is going to be started from X terminal emulators or ssh sessions only (thus rendering the cons.saver binary completely unneeded).

Configuring MC

Config Files


Configuration Information

The ~/.mc directory and its contents are created when you start mc for the first time. Then you can edit the main ~/.mc/ini configuration file manually or through the MC shell. Consult the mc(1) man page for details.


Installed Programs: cons.saver, mc, mcedit, mcmfmt, and mcview
Installed Libraries: None
Installed Directories: /usr/share/mc and /usr/lib/mc

Short Descriptions


is used internally by mc for saving and restoring the text behind the panels on Linux text console.


is a visual shell.


is an internal file editor.


is used internally by mcview when viewing mailbox files.


is an internal file viewer.

Last updated on 2007-08-05 17:14:40 -0500