Re: mc 4.5.55 scrambles prompt



Hi, Stephan!

> when using xterm's dynamic control sequence feature like this
> 
>   export PS1=$PS1"\[\e]0;\w\a\]"
> 
> which sets xterm's caption to the current working directory,
> mc 4.5.55 shows something like "user host:~ > 0;~" if you're
> in your home. This looks broken, it shouldn't strip anything.

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
"benign" and filtering only the former is worth the trouble.

Actually, I think that the idea of loading the command prompt from the
subshell is broken.  It leads to many little bugs of a different kind.

For example, if you run a command from mc that prints something and you
press Ctrl-O before it finishes, the prompt show the output of the 
command.  It looks very weird.

It's also very easy to make MC prompt out-of-sync with the shell prompt.  
Just do Ctrl-O, "cd ..", Ctrl-O and look at the prompt and at the panel.  
The panel shows the new directory, the prompt is unchanged.

I believe that this feature should be removed from MC at some point
because it cannot be fixed properly - it's broken by design.  In the
meantime don't expect too much from prompt loading.

-- 
Regards,
Pavel Roskin




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