Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I often use the subshell of mc. So I want the promt of mc-subsell to be different form the primary shell. Say, how can I change the sub-prompt like this:

mc:$Current_dir$

many thanks

share|improve this question
add comment

1 Answer 1

This page may help you. An excerpt:

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.

What you wanted:

if ps $PPID |grep mc; then
    PS1="mc: \w"
fi
share|improve this answer
    
Thank you, I've got it. and I modified it like this to support color: PS1='[\033[01;32m]mc:[\033[01;34m]\w[\033[00m]\$ ' –  lymslive Jan 1 '13 at 2:59
    
If my answer solved your question, you can click the hollow green check mark on the left to accept it. –  Jakob Weisblat Jan 1 '13 at 20:21
add comment

Your Answer

 
discard

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.