9

I want to start Midnight Commander in one panel mode.

I know I can toggle it on/off using Alt + t but I want it to be in one panel mode from the start.

How can I do this? Is there a command line switch to enable it ?

1 Answers1

5

The manual does not provide any command-line option to start Midnight Commander as single panel. However, there are two ways of doing it.

First way: It exploits the fact that MC does not auto save setup if you do not exit it using the "built-in" method of pressing F10 or the corresponding exit button on the key-bar.

Follow these steps:

  1. Confirm you have Auto save panels setup option marked under Panel Options.
  2. Toogle MC to single panel mode.
  3. Options > Save setup.
  4. Exit MC.

When you open it again, it should be in single-panel mode. Of course, if you happen to toggle to dual-panel and exit MC with F10, it will auto save setup and when you come back again it will be dual-panel. So you should kill MC by other means, for example, use your window manager close window shortcut. Or kill it with xkill. Or whatever.

Second way: You may verify that MC opens in single-panel if the file ~/.config/mc/panels.ini contains list_format=long for both panels. Then, just write a script that replaces list_format=(anything) with list_format=long and launches MC.

On Linux, the BASH script is simply

 #!/bin/bash
 sed -i 's/list_format=.*/list_format=long/g' /home/(your_user)/.config/mc/panels.ini
 mc

You can then put it in /usr/bin/ and run it whenever you want to start MC.