1

I have a problem with Midnight Commander that I am finding exceptionally annoying. I hope that you can provide some relief to me.

I want to use Midnight Commander without mouse support, with mouse actions invoking my X terminal emulator program's functionality rather than being passed through to Midnight Commander. So I invoke Midnight Commander with the command-line option that does that, via an alias

alias mc='mc -d'

This works all well and good … until I press F4 to edit a file. Because (I think) I am using the so-called internal editor, this brings up mcedit, to which all of my mouse actions are passed because the mouse is enabled in it.

I know that the -d option works when I manually invoke the editor with mcedit -d and a file. How do I get the same when mc invokes the editor with F4?

Midnight Commander has this option of not using the mouse for both its mc and mcedit programs and I want to know how to turn it on throughout the whole of Midnight Commander, including when invoking its supposedly internal editor (that surely, if it were internal, should be respecting the -d option that I gave to mc).

Latter Edit: I have shell variables EDITOR and VISUAL set to '/usr/bin/mcedit', now I just changed them to /usr/bin/mcedit -d ... still don't work, then I tried to set a path with higher priority where I put a script called mcedit that call /usr/bin/mcedit -d $* (verified that is first with which mcedit) ... still same problem

4
  • Can't reproduce this with mc 4.8.21. Commented Jul 17, 2018 at 17:46
  • I cannot get to that mc version, I just tried on Mint 18.3, Mint 19 (which has the same versions with latest Ubuntu - 18.04), also on latest Knoppix, maximum mc version I got was 4.8.19, and all got the same problem in my above question, so, what is your Linux distro ? Commented Jul 17, 2018 at 22:41
  • Debian buster (testing). packages.debian.org/buster/mc Commented Jul 17, 2018 at 22:46
  • @IporSircer what can't you reproduce exactly?
    – rustyx
    Commented Feb 25, 2022 at 10:53

1 Answer 1

0

I had same problem and solve it with making mcedit alias bash file:

  1. Rename /usr/bin/mcedit to /usr/bin/mcedit_orig
  2. And add new bash script file /usr/bin/mcedit with content:
!/bin/bash

mcedit_orig -d "$@"
  1. Change /usr/bin/mcedit file chmod to 755 using this command:
chmod +x /usr/bin/mcedit

mc will work as you will run it, and mcedit will always run with -d parameter

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .