mc 4.5.55 scrambles prompt

Pavel Roskin proski at gnu.org
Fri Mar 22 06:21:24 UTC 2002


Hi, Stephan!

> > It is done on purpose in function strip_ctrl_codes(), file src/util.c.
> > Some of the sequences can create mess on the screen if they e.g. move the
> > cursor.  I don't think that separating the sequences into "harmful" and
> 
> Please don't try to make mc "smart" so it fixes messes a user maybe causes,
> he should notice and fix it himself if he included such harming sequences
> eg by defining a "clean" prompt for Midnight Commander in ~/.mc/bashrc .

This function was introduced back in 1994, before I even heard of Midnight
Commander.  So I'm not trying to make mc smart.

You are assuming a certain sequence of events, namely that the prompt is
changed while mc is being actively used.  If you consider somebody already
having a fancy prompt trying mc the first time, the problem may be less
trivial for that user.

As I said, there is no guarantee that only the symbols from the shell
prompt appear in the mc prompt.  Run "find /" and press Ctrl-O before it
finishes.  This bug needs to be fixed, but nobody has fixed it so far. Not
filtering the prompt could cause mess all over the screen, not just in the
command line.

> The latter can now be only used to fix the cosmetic issue but I would
> love to see the current working directory displaying as caption. :-)

Ideally, MC could interpret PS1 or some other variables in the way other
shells do it.  I never liked load_prompt(), I just have other priorities 
now.

-- 
Regards,
Pavel Roskin




More information about the mc-devel mailing list