Bash allows users to do very advanced things when defining shell prompt, including colours and propagation of information into xterm title. Unfortunately, when you want to use mc (Midnight Commander) in conjunction with bash prompts, you may find, that not all advanced escape sequences are handled by mc properly. To overcome this issue you can have a special prompt just for mc. To achieve that, consider the following shell snippet:

if ps $PPID |grep mc; then
        PS1="[\u@\h:\w]\$ "
$BLUE[$RED\$(date +%H%M)$BLUE]\

The resulting prompt will look something like this:

[andre@host:/a/b/c/project/subproject]$ |
Tags: None
Categories: None |

4 comments have been posted.

    July 27, 2014, 6:12 a.m. - Pavel  
    I think the better idea is to create (or modify) this file ~/.local/share/mc/bashrc. This file will be used as a sub-shell rc-file.
    June 22, 2017, 1:14 a.m. - Vadym  
    thanks for the idea
    March 11, 2012, 11:03 p.m. - Juri  
    Thanks for sharing the idea. Helped me to set a simplified (and unbroken) prompt for zsh if started with mc.
    July 22, 2011, 12:04 p.m. - Zakaria  
    Good tutorial, simple and easy
Your email: we will send you a confirmation link to this address to confirm your identity and to prevent robot posting
Get in touch
Join notification list

Join the email list to get notified about new posts and other updates

Follow updates

Join our social networks and RSS feed to keep up to date with latest news and publications