Page 1 of 3

console control codes in 4.1FE

Posted: Sun Apr 05, 2015 9:52 pm
by lazi
Hi!

I am going to release an update to PDFToolkit, but found that the program looks broken in 4.1FE consoles.

I present the problem with a simple echo command in the shell.
Here is a picture from the UAE 3.1 installation (it is the same on 4.1 update 6, but I can't boot it now):
Image

And here is the OS4.1FE result with the a same control codes:
Image

You can see the the background color is rewritten from the first character in the row instead of just for the printed characters.
If it is an intended change, I have to find a workaround.
Can't found anything about the change.

Please let me know the reason of the new behaviour.


Thanks!

Edit: changed the url of the images

Re: console control codes in 4.1FE

Posted: Sun Apr 05, 2015 11:26 pm
by tonyw
That is not an intended change and could be a bug.

I'll take a look at it.

(time passes)

I confirm that it is a bug, submitted as #9193.

Re: console control codes in 4.1FE

Posted: Mon Apr 06, 2015 6:16 pm
by lazi
Thank you very much!

Re: console control codes in 4.1FE

Posted: Tue Apr 07, 2015 3:31 am
by tonyw
OK, I've found the fault and fixed it, but I haven't released it to the betatesters yet.

The fixed version will not be released to the public for some time, so I suggest that you invoke a work-around anyway.

The problem is caused by the order of the operations:
1. Change background colour;
2. Position cursor to new place past the end of the line;
3. Fill with new spaces from the end of the line to where the new text is going;
4. Write the new text ("oo"" in your example).

Step 3 fills the line with spaces, but the new "fill" spaces are written in the new background colour. If you are over-writing existing characters, the problem does not occur, it only occurs when filling past the end of a line.

One work-around that I recommend is to change the order of operations:

if (new place is past the end of the line)
{
move cursor to end of line;
draw spaces until you get to the new place;
}
else
move cursor to new place;
change background and/or foreground colours;
write the new text.

That should work OK.

Re: console control codes in 4.1FE

Posted: Tue Apr 07, 2015 10:05 am
by trixie
tonyw wrote:The fixed version will not be released to the public for some time
The reason being... what?

Re: console control codes in 4.1FE

Posted: Tue Apr 07, 2015 2:09 pm
by tonyw
It takes time for a changed component to be submitted to all the regression testing that the betatesters do. The few times that we have released "quick fixes" without going through the betatest stage, have all led to unanticipated problems.

At a guess, I would say a couple of months minimum before we are confident enough of this change, to release it. I don't know how that lines up with any planned updates.

Re: console control codes in 4.1FE

Posted: Tue Apr 07, 2015 4:24 pm
by Raziel
@tonyw

I found another strange behaviour with ESC colouring.

Code: Select all

echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
echo "*E[42mFirst Test...*E[0minbetween test*E[46m...second inbetween test"
echo "*E[42mSecond Test...*E[0minbetween test"
Try the attached example (simple) in a complete empty shell window (cls)
Everything works fine.
The first text is on a white background, the second text is normal and the third text (if printed) is on a light gray background.

Once the printout reaches the bottom of the shell and starts scrolling though, the light gray background is filling up the entire width of the line where it shouldn't even be printed/used at all (on the lines where no "second inbetween" text is printed - there isn't even the ESC code sequence in those lines).

Image
Link to picture

Could you please check and maybe add it to the bug report?

Thanks a lot

Re: console control codes in 4.1FE

Posted: Wed Apr 08, 2015 12:14 am
by tonyw
Yes, I'm aware of that one and working on it atm. It's the same as appears on the end of the 4th line in lazi's original post.

Re: console control codes in 4.1FE

Posted: Wed Apr 08, 2015 7:01 am
by Raziel
Thank you :-)

Re: console control codes in 4.1FE

Posted: Mon Feb 06, 2017 8:59 am
by lazi
Hi!

After the FE update my machine have this:
con-handler 53.78
console.device 53.99

The problem is the same as you can see in post #1.

Bye!