Re: MC BUG: weird behavior if hit ENTER during command



Hello!

> Detailed description:
> 1. From mc start some command that takes few seconds.
> 2. Hit ENTER on it before it completes.
> 3. Command exist fine, mc panels reappear ok.
> 4. Run any other command, say "ls".
> 5. panels reappear instanteneously *before* command completes.
> 6. "ls" output follows *below* mc panels. In the line where comands
>    are typed. Lines follow one another very fast, panels stay unchanged.
>     *****This is bug. Why doesn't it keep panels hidden while running next
> command? *****
> 7. Last line of the last command's output becomes "command prompt" under
> panels
>     *****Why? It shouldn't******

I can reproduce this bug on Linux easily.

After a few hours of debugging, I finally understand what is going on, but
it will take some time to make a fix.

Shell prompt is sent to the same file descriptor as the command output.  
To separate the output from the prompt, the shell is instructed to stop
itself by the SIGSTOP signal before it displays the prompt.  mc gets the
SIGCHLD signal, restarts the subshell, and its remaining output is
considered the prompt.

Now, if you press Enter which wasn't consumed by the program, the shell
interprets it.  So, after mc restarts the shell, the shell reads Enter,
and stops itself again before printing the prompt one more time!

Now, mc gets the SIGCHLD signal one more time, and desides that the next 
command has already finished, even before it is started.  So, the whole 
output of the next command is interpreted as the shell prompt!

I think you have reported a bug of the year :-)

-- 
Regards,
Pavel Roskin




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