Saturday, June 21, 2008

Dual pane Linux file managers: mc and emelfm

I have been computing all my life without using a dual pane file manager until one day I decided that having one will greatly enhance my qualify of life. What I had in mind was something that will make my life easier in the copying or moving of files from 1 directory to another.

By dual pane (or twin-pane) file manager, I mean a file manager that displays two directories side by side (one active, one passive). The term is confusing because often a dual pane file manager has a third pane that lets you enter commands to execute on the active directory.

Staying true to my preference for Command Line Interface (CLI), I first tried Midnight Commander (mc). As advertised, mc is a file manager that is loaded with features. What I am looking for though is modest: a file manager with 2 directory panes that will satisfy my very basic day-to-day file management needs.

I found myself customizing the look and feel of mc in the early adoption stage. The nostalgic white text on blue background had to go.

You can run mc with the -b option to force black and white.
$ mc -b

If you don't want to go that far, you can customize the color used by editing the init file (~/.mc/ini).

I inserted the following lines into the ~/.mc/ini file.


I also rearranged the panes so that they are placed horizontally (instead of vertically). You can interactively customize the placement using the mc Options menu (when you are already in mc). Alternatively, you can edit the ~/.mc/ini file, and make sure that the following horizontal_split line appears in the [Midnight-Commander] section:

My mc window looked like this after the above customization.

Another major annoyance is that if you run mc in a Gnome window, you cannot use the F10 key to quit mc. It turns out that F10 is normally the key to access the menu-bar in Gnome. To quit mc, you use your mouse to click the Quit soft-key.

If it bothers you as much as it bothered me, you might want to disable the standard F10 menu-bar shortcut key for Gnome. To do that:
$ gconftool-2 --set /apps/gnome-terminal/global/use_menu_accelerators --type bool false

After giving it a good run for about 3 weeks, I gave up on mc. The determining factor was how mc handles the Tab key.

Like other dual pane file managers, mc has a third pane that acts as the command line input window. However, the type of commands that will run in that window seems very limited. I tried commands such as date, pwd, ls, but they all showed no output. The most annoying feature to me is the Tab key. I am used to tapping the Tab key in a bash window for command completion. If you hit Tab while you are typing away in the mc's command line window, the effect is that mc switches the active focus to the other pane.

I won't be surprised if someone tells me there is a way to customize the handling of the Tab key. But, at that point in time, I concluded that I will look for some other file manager that requires less adjustment and customization.

I first became aware of emelfm because it is packaged with the Damn Small Linux (DSL) distribution. I decided to take a look at it because if it is included in DSL, it should be simple enough to satisfy my modest needs.

emelfm is a GUI-based double pane file manager. It has a clean, simple, and intuitive UI. It does the basic file copying and moving. It also has some nice additional features such as the ability to set bookmarks and apply filters to filenames.

One minor annoyance I find is when I try to copy a file in the active window to the same location. Essentially, what I want to do is copy and paste a file (to a new name) in the same directory in the active pane. I cannot use the Copy button to do it because it will only copy the file to the other pane. Instead, I need to enter the cp command explicitly in emelfm's command line window to do the copy.

[P. Evans pointed out that emelfm has a Clone plugin that copies a file to the same directory. Click Configure and then Buttons. Add a button and select the Clone plugin.]

Using the command line window in emelfm turns out to be a pleasant experience (as compared to mc). Hitting the Tab key will only switch the active pane if your mouse cursor is not in the command line window. If the cursor is in the command line window, hitting the Tab key does what I expect: command and filename completion. The commands that did not work in mc all worked well in emelfm (date, pwd, ls).

I have been happily using emelfm since then. There are other GUI-based dual pane file managers out there: e.g., Krusader, Double Commander. I have not tried them. However, I do most file management on the CLI, and only occasionally use a GUI-based file manager to do file copying. As such, emelfm satisfies my requirement for a GUI-based file manager.


Anonymous said...

Let's try XFE, you wount use other FM-s

Anonymous said...

The 'Clone' button is exactly for copying a file in the current dir to a new name.

Regards, Paul Evans

Peter Leung said...

Thanks, Paul.

The version of emelFM I have (0.9,2) does not have Clone. But I will definitely look for it when I upgrade.


John said...

In mc, use esc-tab, not tab,for completion.

In mc, the CLI is a full-featured normal shell. The reason that you couldn't see the output from the CLI was that, due to normal shell scrolling, it was under the file panes. To see the shell output, you can, at any time, lower the file panes (ctrl-o). Then, use Ctrl-o when you want to raise them again.

To make sure that you see all CLI output, go to "Options" --> "Configuration" --> "Pause after run" and select Always. This keeps the file panes lowered after each command until you hit any key.

Andy said...

esc-tab -- cool! thx John! :)

bitsbam said...

appreciate your write up on mc. i am just getting into using it myself.

Anonymous said...

I know this is quite an old post but...
You can also configure almost any mc keybinding through the mc.keymap file.
The first time I used mc I found quite frustating its handling of the ESC key and its navigation system (I really don't know how to call it). Then the old_esc_mode and navigate_with_arrows options came by. ^^

toolleeo said...

recently in tried vifm: pretty nice CLI dual pane.

Arthur Endlein said...

Yeah, commenting on an old post...
Anyway, have you ever heard of muCommander? I'm pretty happy with it, specially considering that it can work in any platform.
Consider taking a look.

pat toche said...

Thanks for this review, your experience with mc is similar to mine, there is gnome-commander which works alright, but my all-time favourite is Krusader, I strongly recommend it. Sadly Krusader crashes kde on one of my laptops and until I find out the reasons I'm going to have to use something else. Dolphin, the default manager in Kubuntu doesn't let you tab back and forth between panels! so it won't do. I'm going to give emelfm (what a horrible name) a try, thanks!

pat toche said...

you want to take a look at this, I've only played around with it for a short while but it's pretty nifty,

the name: Sunflower, python-based dual-pane manager.