I use ini-customized color theme in Midnight Commander 4.8.


When I launch xterm and then manually launch mc it works OK but when I use xterm -e mc I get green panels instead of dark blue.

All the environment variables are the same in both cases. Same behavior in gnome-terminal or terminator.

So what's the proper way to launch it?

1 Answer 1


How did you check that env vars are the same? Running printenv or something similar from mc is unreliable: there bashrc has been sourced after mc was started. Instead you should look at /proc/XX/environ where XX corresponds to mc's pid. You need to convert 0 bytes into newlines, e.g. (if only a single mc process is running):

tr '\0' '\n' < /proc/`pidof mc`/environ

I have a feeling that the difference will be somewhere around $TERM (e.g. xterm vs. xterm-256color) or $COLORTERM.

  • Thanks! The problem is exactly as you said: the shell inside MC shows TERM=xterm-256color while the MC process itself gets TERM=xterm.
    – jackhab
    Apr 27, 2015 at 8:01
  • You've probably already figured out a solution from here; but for reference one possibility is xterm -e env TERM=xterm-256color mc
    – egmont
    Apr 27, 2015 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.