MC window resize


Forum: Apps
Topic: MC window resize
started by: Max

Posted by Max on Jan. 12 2005,17:39
How do you configure Midnight Commander so that when you resize the window, the pane also resize to fill the available space of the term window.  I end up with a little square in the top left of the window.
Posted by mikshaw on Jan. 12 2005,19:49
It's not configurable.  Apparently mc was compiled for DSL without that ability.  I tested it by replacing just the binary (and a couple of needed libs), leaving configuration files untouched, and the windows automatically resized in the new version.

You can get around this by changing the properties of the terminal window before launching mc.  For example you could change your mc menu item to something like this:
[exec] (midnight commander) {rxvt -rv -g 140x40 -e mc.bin -b}
(the -rv and -b options have nothing to do with anything...just thought I'd throw them in)

Posted by ke4nt1 on Jan. 12 2005,21:38
Try this..

1. Open a shell, size it however your wish, even fullscreen
2. Run this command  -  mc.bin

Let us know..

73
ke4nt

Posted by Max on Jan. 13 2005,02:18
That worked great.

Another little nagging thing.  For some reason I can only use mc as root.  When I start the normal (non-root) mc from the menu I get the notice "Hotload list: was unable to write ~/.mc/hotlist file, your old hotlist entries were not delet"  Same thing when I start from command line.  Starting as root works fine though.  

I noticed that /home/dsl/.mc/hotlist is set for only root r/w permissions.  Was this an oversight?

Posted by mikshaw on Jan. 13 2005,02:32
It's a bug in the menu item.  The 'mc as super user' menu item launches mc with dsl's environment, so it uses /home/dsl/.mc for its configurations.  If you start mc as root from the menu before starting it as dsl, that .mc directory will be created with root ownership, meaning dsl cannot write to it.

There are a couple of ways to avoid this...
1) start mc as dsl before starting it as root...this creates the config files with dsl ownership.  After this first time you can go back and forth between root and dsl without trouble.
2) start 'mc as super user' with the command 'sudo su -c mc.bin'.  This starts mc with root's environment, and the config files will not be written to /home/dsl/.mc

If you already have this problem, as root you can delete or change ownership of the /home/dsl/.mc directory and its contents (not while mc is running) and then start it as dsl.

Personally I don't see the point in having a wrapper for mc.  If you just want to change the background color of mc depending on whether you are dsl or root you can do that in the menu item:
[exec] (midnight commander) {rxvt -bg blue -T "midnight commander" -e /usr/local/bin/mc.bin}
[exec] (mc as super-user) {rxvt -bg red -T "root mc" -e sudo su -c /usr/local/bin/mc.bin}
EDIT: I forget  I use the '-b' option in mc, so background is the same as the terminal's background, so maybe it won't work as simply as that.

Posted by Max on Jan. 13 2005,03:40
Thanks.  That explains it well.
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.