starting Midnight Commander in a terminal with Awesome WM

I wanted a shortcut to launch a file manager using WIN-F, sort of like with Crunchbang. I'm slowly trying to get used to Midnight Commander as my file manager, instead of Nautilus. So I needed a terminal to launch with mc running. Sounds easy, right?

I was seeing a weird bug with mc not filling the terminal when running it as a parameter to a terminal command.

Examples:

terminator -e mc was giving me

terminator with midnight commander

while

gnome-terminal -e mc

gave me

gnome-terminal with midnight commander

xterm gave something similiar as well.

Seemed to work fine on Gnome, so it was something Awesome related, possiby to fo with Awesome resizing the window AFTER mc had sized itself, leaving it with the wrong size.

So I thought maybe there was some way to make it start after the window had been resized. Couldn't find a way to do that, but found a simple solution - just make it wait a bit.

So for terminator the command became

terminator -e 'sleep 0.1; mc'

and for gnome-terminal

gnome-terminal -x bash -c 'sleep 0.1; mc'

This gives Awesome time to resize the window and Midnight Commander then can size itself to fill the terminal.

So then I just added

awful.key({ modkey,           }, "f", function () awful.util.spawn("terminator -e 'sleep 0.1; mc'") end),

to my key bindings section of rc.lua.