How to determine if a shell is running under MC...?



Congrats and thanks for v.4.6.0!!

One change is that the ENV variable MC_CONTROL_FILE is gone.
I used it's existance to set my shell's prompt a certain way:

  ~/.bashrc

    MYTTYNUM=`tty`
    MYTTYNUM=${MYTTYNUM##/dev/tty}
    MYTTYNUM=${MYTTYNUM##/dev/pts/}
--> if [ "$MC_CONTROL_FILE" ] ; then
       PS1='[\h [$MYTTYNUM] \W]\$ '
    elif [ "$TERM" = "linux" ] ; then
       PS1='[\h [$MYTTYNUM] \W]\$ '
    elif ( expr "$TERM" : "xterm" >/dev/null ) ; then
       PS1='\[^[]0;[ \h - \w ]^G\][\h [$MYTTYNUM] \W]\$ '
    else
       PS1='[\h [$MYTTYNUM] \W]\$ '
    fi

Now, I'm not sure how I can accomplish this test...  As it is now, my
regular xterm prompt is being used, but the embedded escape sequences
that normally manipulate the xterm title bar just make things messy
under MC (and MC can handle the xterm title bar itself anyway).

Thanks,

- Tor




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]