Midnight Commander on Main Menu doesn't work

A minor issue for sure. I started using Midnight Commander recently. It loads fine as a terminal window, then entering the mc command. I noticed that it is also available as an icon in the main menu, under system tools. However it only opens a blank terminal window without a command line and no MC. Using the main menu editor shows that it is simply “run in terminal” and the command of “mc”. That should work, but doesn’t. Does anyone have a way to fix this minor glitch?

Love MC, just would like to have a lazy single click command in the toolbar if possible.

Indeed!

Well, it could be a bug or wrong default in lxterminal. I don’t have time to look at it closely, but here’s a quick hack that should fix it - if you don’t mind:

open a terminal and type the following:


$ su -l
# cp /usr/share/applications/mc.desktop{,.orig} && sed -i 's|Exec=mc|Exec=lxterminal -e mc|;s|Terminal=true|Terminal=false|' /usr/share/applications/mc.desktop

That should fix it for all users. Please report if it does not.

Probably one of the most useful programs in Linux and Unix history. That one should be on the live CD too! :wink:

Once it works (an it will), notice that you can change the default size of the terminal window. To do this, open the file /usr/share/applications/mc.desktop (the one we just modified) as root in a text editor and replace this line:

Exec=lxterminal -e mc

with this one:

Exec=lxterminal **--geometry=120x40 **-e mc

where you can obviously set any number of columns and rows you like.

Here’s a diff that shows the changes applied to the .desktop file:

# diff -u /usr/local/share/applications/mc.desktop{.orig,}
--- /usr/local/share/applications/mc.desktop.orig       2013-01-15 15:15:01.534588656 -0800
+++ /usr/local/share/applications/mc.desktop    2013-01-15 15:33:03.175368878 -0800
@@ -3,8 +3,8 @@
 Categories=X-Main;
 Type=Application
 Name=Midnight Commander
-Exec=mc
-Terminal=true
+Exec=lxterminal --geometry=120x40 -e mc
+Terminal=false
 Icon=mc

  • It should be /usr/share/applications in your case.

On 2013-01-16 00:36, please try again wrote:
> Probably one of the most useful program in Linux and Unix history. That
> one should be on the live CD too! :wink:

Indeed.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

Thanks! One additional note for the launch bar. It seems that the mc.desktop is copied, as opposed to linked into the launch bar. So any changes made in the config (screen size) were not active in the launch bar button until it was reopened, deleted, and a fresh mc placed back into the launch bar.

Love it, and thanks!

That’s correct.

You’re welcome.