Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I observed that my custom bash prompt does not work on mc. How do I customize it?

share|improve this question
WHere do you set your custom bash prompt? – Mark Nov 23 '12 at 13:43
My custom bash prompt is setup in .bash_profile – sorin Nov 23 '12 at 14:01
up vote 2 down vote accepted

The issue is that .bash_login files are only read when bash is run as the login shell. mc probably just calls a new shell which will read its startup from ~/.bashrc See bash documentation for details.

To make the shell run in a common way it is often suggested that you call .bashrc from .bash_login e.g.

if [ -f ~/.bashrc ]; then
   source ~/.bashrc
share|improve this answer
I did this and now I see the prompt correctly, still there is a difference: all ANSI escapes had vanished from mc prompts, it's not colored. – sorin Nov 23 '12 at 15:16
I suspect $TERM has been changed as man mc says it is " run it in a pseudo terminal," – Mark Nov 24 '12 at 0:39
That bugreport has clear answer: >> Is there a way to get the prompt colors show up also in MC? > Unfortunately no. It is not supported, аll control sequences in the > prompt are ignored. – Hubbitus Aug 18 '15 at 16:16

Read the INVOCATION section of the man page, it's there for a reason. MC is most likely not launching a login shell and you are only configuring your prompt for login shells.

share|improve this answer
Excerpt from man mc: "An extra added feature of using the subshell is that the prompt displayed by the Midnight Commander is the same prompt that you are currently using in your shell." - As you probably observed this is not true, the prompt is clearly not the same, in fact I suspect it's the default prompt for bash bash-3.2$. – sorin Nov 19 '12 at 9:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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